@@ -24,39 +24,39 @@ namespace o2::calibration
2424
2525 void init (o2::framework::InitContext& ic) final
2626 {
27- if (ic.options ().hasOption (" slot-len-sec" )) {
28- mSlotLenSec = ic.options ().get <uint32_t >(" slot-len-sec" );
29- }
30- if (ic.options ().hasOption (" one-object-per-run" )) {
31- mOneObjectPerRun = ic.options ().get <bool >(" one-object-per-run" );
32- }
33- if (ic.options ().hasOption (" slot-len-tf" )) {
34- mSlotLen = ic.options ().get <o2::calibration::TFType>(" slot-len-tf" );
35- }
36- if (ic.options ().hasOption (" min-entries-number" )) {
37- mMinNumberOfEntries = ic.options ().get <uint32_t >(" min-entries-number" );
38- }
39- if (ic.options ().hasOption (" min-ampl-side-a" )) {
40- mMinAmplitudeSideA = ic.options ().get <int32_t >(" min-ampl-side-a" );
41- }
42- if (ic.options ().hasOption (" min-ampl-side-c" )) {
43- mMinAmplitudeSideC = ic.options ().get <int32_t >(" min-ampl-side-c" );
44- }
27+ if (ic.options ().hasOption (" slot-len-sec" )) {
28+ mSlotLenSec = ic.options ().get <uint32_t >(" slot-len-sec" );
29+ }
30+ if (ic.options ().hasOption (" one-object-per-run" )) {
31+ mOneObjectPerRun = ic.options ().get <bool >(" one-object-per-run" );
32+ }
33+ if (ic.options ().hasOption (" slot-len-tf" )) {
34+ mSlotLen = ic.options ().get <o2::calibration::TFType>(" slot-len-tf" );
35+ }
36+ if (ic.options ().hasOption (" min-entries-number" )) {
37+ mMinNumberOfEntries = ic.options ().get <uint32_t >(" min-entries-number" );
38+ }
39+ if (ic.options ().hasOption (" min-ampl-side-a" )) {
40+ mMinAmplitudeSideA = ic.options ().get <int32_t >(" min-ampl-side-a" );
41+ }
42+ if (ic.options ().hasOption (" min-ampl-side-c" )) {
43+ mMinAmplitudeSideC = ic.options ().get <int32_t >(" min-ampl-side-c" );
44+ }
4545
46- mCalibrator = std::make_unique<o2::ft0::EventsPerBcCalibrator>(mMinNumberOfEntries , mMinAmplitudeSideA , mMinAmplitudeSideC );
46+ mCalibrator = std::make_unique<o2::ft0::EventsPerBcCalibrator>(mMinNumberOfEntries , mMinAmplitudeSideA , mMinAmplitudeSideC );
4747
48- if (mOneObjectPerRun ) {
49- LOG (info) << " Only one object will be created at the end of run" ;
50- mCalibrator ->setUpdateAtTheEndOfRunOnly ();
51- }
52- if (mOneObjectPerRun == false && mSlotLen == 0 ){
53- LOG (info) << " Defined slot interval to " << mSlotLenSec << " seconds" ;
54- mCalibrator ->setSlotLengthInSeconds (mSlotLenSec );
55- }
56- if (mOneObjectPerRun == false && mSlotLen != 0 ) {
57- LOG (info) << " Defined slot interval to " << mSlotLen << " TFS" ;
58- mCalibrator ->setSlotLength (mSlotLen );
59- }
48+ if (mOneObjectPerRun ) {
49+ LOG (info) << " Only one object will be created at the end of run" ;
50+ mCalibrator ->setUpdateAtTheEndOfRunOnly ();
51+ }
52+ if (mOneObjectPerRun == false && mSlotLen == 0 ) {
53+ LOG (info) << " Defined slot interval to " << mSlotLenSec << " seconds" ;
54+ mCalibrator ->setSlotLengthInSeconds (mSlotLenSec );
55+ }
56+ if (mOneObjectPerRun == false && mSlotLen != 0 ) {
57+ LOG (info) << " Defined slot interval to " << mSlotLen << " TFS" ;
58+ mCalibrator ->setSlotLength (mSlotLen );
59+ }
6060 }
6161
6262 void run (o2::framework::ProcessingContext& pc) final
@@ -74,26 +74,26 @@ namespace o2::calibration
7474
7575 void endOfStream (o2::framework::EndOfStreamContext& ec) final
7676 {
77- LOG (info) << " Received end-of-stream, checking for slot to finalize..." ;
78- mCalibrator ->checkSlotsToFinalize ();
79- sendOutput (ec.outputs ());
80- mCalibrator ->initOutput ();
77+ LOG (info) << " Received end-of-stream, checking for slot to finalize..." ;
78+ mCalibrator ->checkSlotsToFinalize ();
79+ sendOutput (ec.outputs ());
80+ mCalibrator ->initOutput ();
8181 }
8282
8383 void sendOutput (o2::framework::DataAllocator& output)
8484 {
8585 using o2::framework::Output;
8686 const auto & tvxHists = mCalibrator ->getTvxPerBc ();
8787 auto & infos = mCalibrator ->getTvxPerBcCcdbInfo ();
88- for (unsigned int idx = 0 ; idx < tvxHists.size (); idx++){
89- auto & info = infos[idx];
90- const auto & payload = tvxHists[idx];
88+ for (unsigned int idx = 0 ; idx < tvxHists.size (); idx++) {
89+ auto & info = infos[idx];
90+ const auto & payload = tvxHists[idx];
9191
92- auto image = o2::ccdb::CcdbApi::createObjectImage (payload.get (), info.get ());
93- LOG (info) << " Sending object " << info->getPath () << " /" << info->getFileName () << " of size " << image->size ()
94- << " bytes, valid for " << info->getStartValidityTimestamp () << " : " << info->getEndValidityTimestamp ();
95- output.snapshot (Output{o2::calibration::Utils::gDataOriginCDBPayload , " EventsPerBc" , idx}, *image.get ());
96- output.snapshot (Output{o2::calibration::Utils::gDataOriginCDBWrapper , " EventsPerBc" , idx}, *info.get ());
92+ auto image = o2::ccdb::CcdbApi::createObjectImage (payload.get (), info.get ());
93+ LOG (info) << " Sending object " << info->getPath () << " /" << info->getFileName () << " of size " << image->size ()
94+ << " bytes, valid for " << info->getStartValidityTimestamp () << " : " << info->getEndValidityTimestamp ();
95+ output.snapshot (Output{o2::calibration::Utils::gDataOriginCDBPayload , " EventsPerBc" , idx}, *image.get ());
96+ output.snapshot (Output{o2::calibration::Utils::gDataOriginCDBWrapper , " EventsPerBc" , idx}, *info.get ());
9797 }
9898
9999 if (tvxHists.size ()) {
0 commit comments