@@ -94,14 +94,21 @@ int createO2tables(const char* inputFile = "delphes.root",
9494
9595 // smearer
9696 o2 ::delphes ::TrackSmearer smearer ;
97- smearer .loadTable (11 , "lutCovm.el.dat" );
98- smearer .loadTable (13 , "lutCovm.mu.dat" );
99- smearer .loadTable (211 , "lutCovm.pi.dat" );
100- smearer .loadTable (321 , "lutCovm.ka.dat" );
101- smearer .loadTable (2212 , "lutCovm.pr.dat" );
97+ std ::map < int , const char * > mapPdgLut ;
98+ mapPdgLut .insert (std ::make_pair (11 , "lutCovm.el.dat" ));
99+ mapPdgLut .insert (std ::make_pair (13 , "lutCovm.mu.dat" ));
100+ mapPdgLut .insert (std ::make_pair (211 , "lutCovm.pi.dat" ));
101+ mapPdgLut .insert (std ::make_pair (321 , "lutCovm.ka.dat" ));
102+ mapPdgLut .insert (std ::make_pair (2212 , "lutCovm.pr.dat" ));
102103 if (enable_nuclei ) {
103- smearer .loadTable (1000010020 , "lutCovm.de.dat" );
104- smearer .loadTable (1000020030 , "lutCovm.he3.dat" );
104+ mapPdgLut .insert (std ::make_pair (1000010020 , "lutCovm.de.dat" ));
105+ mapPdgLut .insert (std ::make_pair (1000020030 , "lutCovm.he.dat" ));
106+ }
107+ for (auto e : mapPdgLut ) {
108+ if (!smearer .loadTable (e .first , e .second )) {
109+ Printf ("Having issue with loading the LUT %i '%s'" , e .first , e .second );
110+ return 1 ;
111+ }
105112 }
106113
107114 // TOF layer
@@ -170,6 +177,8 @@ int createO2tables(const char* inputFile = "delphes.root",
170177
171178 // Load selected branches with data from specified event
172179 treeReader -> ReadEntry (ientry );
180+ const float multEtaRange = 2.f ; // Range in eta to count the charged particles
181+ float dNdEta = 0.f ; // Charged particle multiplicity to use in the efficiency evaluation
173182
174183 for (Int_t iparticle = 0 ; iparticle < particles -> GetEntries (); ++ iparticle ) { // Loop over particles
175184 auto particle = (GenParticle * )particles -> At (iparticle );
@@ -207,8 +216,12 @@ int createO2tables(const char* inputFile = "delphes.root",
207216 mcparticle .fVz = particle -> Z * 0.1 ;
208217 mcparticle .fVt = particle -> T ;
209218
219+ if (TMath ::Abs (particle -> Eta ) <= multEtaRange && particle -> D1 < 0 && particle -> D2 < 0 && particle -> Charge != 0 ) {
220+ dNdEta += 1.f ;
221+ }
210222 FillTree (kMcParticle );
211223 }
224+ dNdEta = 0.5f * dNdEta / multEtaRange ;
212225 fOffsetLabel += particles -> GetEntries ();
213226
214227 // loop over tracks
@@ -246,7 +259,7 @@ int createO2tables(const char* inputFile = "delphes.root",
246259
247260 O2Track o2track ; // tracks in internal O2 format
248261 o2 ::delphes ::TrackUtils ::convertTrackToO2Track (* track , o2track , true);
249- if (!smearer .smearTrack (o2track , track -> PID )) { // Skipping inefficient/not correctly smeared tracks
262+ if (!smearer .smearTrack (o2track , track -> PID , dNdEta )) { // Skipping inefficient/not correctly smeared tracks
250263 continue ;
251264 }
252265 o2 ::delphes ::TrackUtils ::convertO2TrackToTrack (o2track , * track , true);
0 commit comments