@@ -50,11 +50,15 @@ Generator::Generator() : FairGenerator("ALICEo2", "ALICEo2 Generator"),
5050 if (transport) {
5151 bool tpcActive = (std::find (simConfig.getReadoutDetectors ().begin (), simConfig.getReadoutDetectors ().end (), " TPC" ) != simConfig.getReadoutDetectors ().end ());
5252 if (tpcActive) {
53- if (initLoopersGen ()){
53+ if (initLoopersGen ()) {
5454 mAddTPCLoopers = kTRUE ;
5555 }
56+ } else {
57+ LOG (info) << " TPC not active in readout detectors: loopers fast generator disabled." ;
5658 }
5759 }
60+ } else {
61+ LOG (info) << " Loopers fast generator turned OFF with veto flag." ;
5862 }
5963#endif
6064}
@@ -78,8 +82,12 @@ Generator::Generator(const Char_t* name, const Char_t* title) : FairGenerator(na
7882 if (initLoopersGen ()) {
7983 mAddTPCLoopers = kTRUE ;
8084 }
85+ } else {
86+ LOG (info) << " TPC not active in readout detectors: loopers fast generator disabled." ;
8187 }
8288 }
89+ } else {
90+ LOG (info) << " Loopers fast generator turned OFF with veto flag." ;
8391 }
8492#endif
8593}
@@ -97,8 +105,14 @@ bool Generator::initLoopersGen()
97105 const auto & scaler_compton = gSystem ->ExpandPathName (loopersParam.scaler_compton .c_str ());
98106 const auto & poisson = gSystem ->ExpandPathName (loopersParam.poisson .c_str ());
99107 const auto & gauss = gSystem ->ExpandPathName (loopersParam.gauss .c_str ());
100- auto flat_gas = loopersParam.flat_gas ;
108+ const auto & flat_gas = loopersParam.flat_gas ;
109+ const auto & colsys = loopersParam.colsys ;
101110 if (flat_gas) {
111+ if (colsys != " PbPb" && colsys != " pp" ) {
112+ LOG (warning) << " Automatic background loopers configuration supports only 'pp' and 'PbPb' systems." ;
113+ LOG (warning) << " Fast loopers generator will remain OFF." ;
114+ return kFALSE ;
115+ }
102116 bool isContext = std::filesystem::exists (" collisioncontext.root" );
103117 if (!isContext) {
104118 LOG (warning) << " Warning: No collisioncontext.root file found!" ;
@@ -156,17 +170,12 @@ bool Generator::initLoopersGen()
156170 try {
157171 // Create the TPC loopers generator with the provided parameters
158172 mLoopersGen = std::make_unique<o2::eventgen::GenTPCLoopers>(model_pairs, model_compton, poisson, gauss, scaler_pair, scaler_compton);
159- auto & colsys = loopersParam.colsys ;
160- auto &intrate = loopersParam.intrate ;
173+ const auto &intrate = loopersParam.intrate ;
161174 // Configure the generator with flat gas loopers defined per orbit with clusters/track info
175+ // If intrate is negative (default), automatic IR from collisioncontext.root will be used
162176 if (flat_gas) {
163- if (colsys != " PbPb" && colsys != " pp" ) {
164- LOG (fatal) << " Error: collision system must be either 'PbPb' or 'pp'" ;
165- exit (1 );
166- } else {
167- mLoopersGen ->SetRate (nclxrate, (colsys == " PbPb" ) ? true : false , intrate);
168- mLoopersGen ->SetAdjust (loopersParam.adjust_flatgas );
169- }
177+ mLoopersGen ->SetRate (nclxrate, (colsys == " PbPb" ) ? true : false , intrate);
178+ mLoopersGen ->SetAdjust (loopersParam.adjust_flatgas );
170179 } else {
171180 // Otherwise, Poisson+Gauss sampling or fixed number of loopers per event will be used
172181 // Multiplier is applied only with distribution sampling
0 commit comments