@@ -522,6 +522,18 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
522522 signal = new MCSignal (name, " Electrons from pi0 decays" , {prong}, {-1 });
523523 return signal;
524524 }
525+ if (nameStr == " ePrimaryFromPi0" ) {
526+ MCProng prong (2 , {11 , 111 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
527+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
528+ signal = new MCSignal (name, " Electrons from primary pi0 decays" , {prong}, {-1 });
529+ return signal;
530+ }
531+ if (nameStr == " eSecondaryFromPi0" ) {
532+ MCProng prong (2 , {11 , 111 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
533+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary , true );
534+ signal = new MCSignal (name, " Electrons from secondary pi0 decays" , {prong}, {-1 });
535+ return signal;
536+ }
525537 if (nameStr == " ePrimaryFromPromptPi0" ) {
526538 MCProng prong (2 , {11 , 111 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false }, false , {502 , 402 }, {true , true });
527539 prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
@@ -533,6 +545,18 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
533545 signal = new MCSignal (name, " Electrons from eta decays" , {prong}, {-1 });
534546 return signal;
535547 }
548+ if (nameStr == " ePrimaryFromEta" ) {
549+ MCProng prong (2 , {11 , 221 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
550+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
551+ signal = new MCSignal (name, " Electrons from primary eta decays" , {prong}, {-1 });
552+ return signal;
553+ }
554+ if (nameStr == " eSecondaryFromEta" ) {
555+ MCProng prong (2 , {11 , 221 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
556+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary , true );
557+ signal = new MCSignal (name, " Electrons from secondary eta decays" , {prong}, {-1 });
558+ return signal;
559+ }
536560 if (nameStr == " eFromEtaPrime" ) {
537561 MCProng prong (2 , {11 , 331 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
538562 signal = new MCSignal (name, " Electrons from eta' decays" , {prong}, {-1 });
@@ -885,6 +909,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
885909
886910 // _________________________________________________________________________________________________________________________
887911 // LMEE pair signals for LF, same mother
912+ if (nameStr == " eeDuplicated" ) { // check whether we have two tracks pointing to the same MC particle
913+ MCProng prong (1 , {11 }, {true }, {false }, {0 }, {0 }, {false });
914+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
915+ signal = new MCSignal (name, " duplicated electron" , {prong, prong}, {0 , 0 }); // signal at pair level
916+ return signal;
917+ }
888918 if (nameStr == " eeFromAnything" ) {
889919 MCProng prong (2 , {11 , MCProng::kPDGCodeNotAssigned }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
890920 prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
@@ -897,6 +927,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
897927 signal = new MCSignal (name, " ee pairs from pi0 decays" , {prong, prong}, {1 , 1 }); // signal at pair level
898928 return signal;
899929 }
930+ if (nameStr == " eeSecondaryFromPi0" ) {
931+ MCProng prong (2 , {11 , 111 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
932+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary , true );
933+ signal = new MCSignal (name, " ee secondary pairs from pi0 decays" , {prong, prong}, {1 , 1 }); // signal at pair level
934+ return signal;
935+ }
900936 if (nameStr == " eePrimaryFromPromptPi0" ) {
901937 MCProng prong (2 , {11 , 111 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false }, false , {502 , 402 }, {true , true });
902938 prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
@@ -909,6 +945,12 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
909945 signal = new MCSignal (name, " ee pairs from eta decays" , {prong, prong}, {1 , 1 }); // signal at pair level
910946 return signal;
911947 }
948+ if (nameStr == " eeSecondaryFromEta" ) {
949+ MCProng prong (2 , {11 , 221 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
950+ prong.SetSourceBit (0 , MCProng::kPhysicalPrimary , true );
951+ signal = new MCSignal (name, " ee pairs from eta decays" , {prong, prong}, {1 , 1 }); // signal at pair level
952+ return signal;
953+ }
912954 if (nameStr == " eeFromEtaprime" ) {
913955 MCProng prong (2 , {11 , 331 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
914956 prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
@@ -1769,7 +1811,7 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
17691811 signal = new MCSignal (name, " Jpsi from Chic2 decays" , {prong}, {1 });
17701812 return signal;
17711813 }
1772- if (nameStr == " JpsiFromChic2 " ) {
1814+ if (nameStr == " JpsiFromChic " ) {
17731815 MCProng prong (2 , {443 , 904 }, {true , true }, {false , false }, {0 , 0 }, {0 , 0 }, {false , false });
17741816 prong.SetSourceBit (0 , MCProng::kPhysicalPrimary );
17751817 signal = new MCSignal (name, " Jpsi from Chic0, Chic1 or Chic2 decays" , {prong}, {1 });
@@ -2038,6 +2080,8 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name)
20382080 signal = new MCSignal (name, " anyprimary and electron pair from non-prompt jpsi" , {pronge, pronge, prongPrimary}, {1 , 1 , -1 });
20392081 return signal;
20402082 }
2083+
2084+ LOGF (warn, " Did not find MC signal %s" , nameStr);
20412085 return nullptr ;
20422086}
20432087
@@ -2080,10 +2124,10 @@ std::vector<MCSignal*> o2::aod::dqmcsignals::GetMCSignalsFromJSON(const char* js
20802124 if (!ValidateJSONMCSignal (&signal, sigName)) {
20812125 LOG (fatal) << " MCSignal JSON not properly defined for " << sigName << " . Skipping" ;
20822126 continue ;
2083- } else {
2084- LOG (debug) << " MCSignal validated" ;
20852127 }
20862128
2129+ LOG (debug) << " MCSignal validated" ;
2130+
20872131 // Get the signal title
20882132 const char * title = (signal.HasMember (" title" ) ? signal.FindMember (" title" )->value .GetString () : " " );
20892133 LOG (info) << " Title is: " << title;
@@ -2121,7 +2165,7 @@ std::vector<MCSignal*> o2::aod::dqmcsignals::GetMCSignalsFromJSON(const char* js
21212165 // Get the common ancestors array
21222166 std::vector<int8_t > commonAncestors;
21232167 if (signal.HasMember (" commonAncestors" )) {
2124- for (auto & v : signal.FindMember (" commonAncestors" )->value .GetArray ()) {
2168+ for (const auto & v : signal.FindMember (" commonAncestors" )->value .GetArray ()) {
21252169 commonAncestors.push_back (v.GetInt ());
21262170 LOG (debug) << " common ancestor " << v.GetInt ();
21272171 }
@@ -2131,7 +2175,7 @@ std::vector<MCSignal*> o2::aod::dqmcsignals::GetMCSignalsFromJSON(const char* js
21312175 }
21322176 }
21332177
2134- if (prongs.size () == 0 ) {
2178+ if (prongs.empty () ) {
21352179 LOG (fatal) << " No prongs were defined for this MCSignal!" ;
21362180 return signals;
21372181 }
@@ -2196,13 +2240,13 @@ bool o2::aod::dqmcsignals::ValidateJSONMCProng(T prongJSON, const char* prongNam
21962240 return false ;
21972241 }
21982242 std::vector<uint32_t > nSourceBits;
2199- for (auto & ii : prongJSON->FindMember (" sourceBits" )->value .GetArray ()) {
2243+ for (const auto & ii : prongJSON->FindMember (" sourceBits" )->value .GetArray ()) {
22002244 if (!ii.IsArray ()) {
22012245 LOG (fatal) << " The sourceBits field should be an array of arrays of MCProng::Source" ;
22022246 return false ;
22032247 }
22042248 nSourceBits.push_back (ii.GetArray ().Size ());
2205- for (auto & iii : ii.GetArray ()) {
2249+ for (const auto & iii : ii.GetArray ()) {
22062250 if (MCProng::fgSourceNames.find (iii.GetString ()) == MCProng::fgSourceNames.end ()) {
22072251 LOG (fatal) << " Source " << iii.GetString () << " not implemented in MCProng" ;
22082252 return false ;
@@ -2215,7 +2259,7 @@ bool o2::aod::dqmcsignals::ValidateJSONMCProng(T prongJSON, const char* prongNam
22152259 return false ;
22162260 }
22172261 int iElem = 0 ;
2218- for (auto & ii : prongJSON->FindMember (" excludeSource" )->value .GetArray ()) {
2262+ for (const auto & ii : prongJSON->FindMember (" excludeSource" )->value .GetArray ()) {
22192263 if (!ii.IsArray ()) {
22202264 LOG (fatal) << " The excludeSource field should be an array of arrays of bool" ;
22212265 return false ;
@@ -2293,21 +2337,21 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
22932337 LOG (debug) << " n: " << n;
22942338 // Get the array of PDG codes
22952339 std::vector<int > pdgs;
2296- for (auto & pdg : prongJSON->FindMember (" pdgs" )->value .GetArray ()) {
2340+ for (const auto & pdg : prongJSON->FindMember (" pdgs" )->value .GetArray ()) {
22972341 pdgs.push_back (pdg.GetInt ());
22982342 LOG (debug) << " pdgs: " << pdg.GetInt ();
22992343 }
23002344 // get the array of booleans for check both charges option
23012345 std::vector<bool > checkBothCharges;
2302- for (auto & ii : prongJSON->FindMember (" checkBothCharges" )->value .GetArray ()) {
2346+ for (const auto & ii : prongJSON->FindMember (" checkBothCharges" )->value .GetArray ()) {
23032347 checkBothCharges.push_back (ii.GetBool ());
23042348 LOG (debug) << " check both charges " << ii.GetBool ();
23052349 }
23062350
23072351 // get the array of booleans for the excludePDG option, defaults to false
23082352 std::vector<bool > excludePDG;
23092353 if (prongJSON->HasMember (" excludePDG" )) {
2310- for (auto & ii : prongJSON->FindMember (" excludePDG" )->value .GetArray ()) {
2354+ for (const auto & ii : prongJSON->FindMember (" excludePDG" )->value .GetArray ()) {
23112355 excludePDG.push_back (ii.GetBool ());
23122356 LOG (debug) << " exclude pdg " << ii.GetBool ();
23132357 }
@@ -2320,9 +2364,9 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
23202364 // get the source bits, and transform from string to int
23212365 std::vector<std::vector<int >> sourceBitsVec;
23222366 if (prongJSON->HasMember (" sourceBits" )) {
2323- for (auto & ii : prongJSON->FindMember (" sourceBits" )->value .GetArray ()) {
2367+ for (const auto & ii : prongJSON->FindMember (" sourceBits" )->value .GetArray ()) {
23242368 std::vector<int > sourceBits;
2325- for (auto & iii : ii.GetArray ()) {
2369+ for (const auto & iii : ii.GetArray ()) {
23262370 sourceBits.push_back (MCProng::fgSourceNames[iii.GetString ()]);
23272371 LOG (debug) << " source bit " << iii.GetString ();
23282372 }
@@ -2332,9 +2376,9 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
23322376 // prepare the exclusion source options if specified
23332377 std::vector<std::vector<bool >> excludeSourceVec;
23342378 if (prongJSON->HasMember (" excludeSource" )) {
2335- for (auto & ii : prongJSON->FindMember (" excludeSource" )->value .GetArray ()) {
2379+ for (const auto & ii : prongJSON->FindMember (" excludeSource" )->value .GetArray ()) {
23362380 std::vector<bool > excludeSource;
2337- for (auto & iii : ii.GetArray ()) {
2381+ for (const auto & iii : ii.GetArray ()) {
23382382 excludeSource.push_back (iii.GetBool ());
23392383 LOG (debug) << " exclude source bit " << iii.GetBool ();
23402384 }
@@ -2345,7 +2389,7 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
23452389 // prepare the useANDonSourceBitMap vector, defaults to true for each generation
23462390 std::vector<bool > useANDonSourceBitMap;
23472391 if (prongJSON->HasMember (" useANDonSourceBitMap" )) {
2348- for (auto & ii : prongJSON->FindMember (" useANDonSourceBitMap" )->value .GetArray ()) {
2392+ for (const auto & ii : prongJSON->FindMember (" useANDonSourceBitMap" )->value .GetArray ()) {
23492393 useANDonSourceBitMap.push_back (ii.GetBool ());
23502394 LOG (debug) << " use AND on source map " << ii.GetBool ();
23512395 }
@@ -2360,12 +2404,12 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
23602404 int igen = 0 ;
23612405 std::vector<uint64_t > sBitsVec ;
23622406 std::vector<uint64_t > sBitsExcludeVec ;
2363- for (auto & itgen : sourceBitsVec) {
2407+ for (const auto & itgen : sourceBitsVec) {
23642408 int is = 0 ;
23652409 uint64_t sBits = 0 ;
23662410 uint64_t sBitsExclude = 0 ;
23672411 auto excludeVec = (hasExclude ? excludeSourceVec[igen] : std::vector<bool >{});
2368- for (auto & s : itgen) {
2412+ for (const auto & s : itgen) {
23692413 bool exclude = (hasExclude ? excludeVec[is] : false );
23702414 if (s != MCProng::kNothing ) {
23712415 sBits |= (static_cast <uint64_t >(1 ) << s);
@@ -2414,15 +2458,15 @@ MCProng* o2::aod::dqmcsignals::ParseJSONMCProng(T prongJSON, const char* prongNa
24142458
24152459 std::vector<int > checkIfPDGInHistory = {};
24162460 if (prongJSON->HasMember (" checkIfPDGInHistory" )) {
2417- for (auto & ii : prongJSON->FindMember (" checkIfPDGInHistory" )->value .GetArray ()) {
2461+ for (const auto & ii : prongJSON->FindMember (" checkIfPDGInHistory" )->value .GetArray ()) {
24182462 checkIfPDGInHistory.push_back (ii.GetInt ());
24192463 LOG (debug) << " checkIfPDGInHistory: " << ii.GetInt ();
24202464 }
24212465 }
24222466
24232467 std::vector<bool > excludePDGInHistory = {};
24242468 if (prongJSON->HasMember (" excludePDGInHistory" )) {
2425- for (auto & ii : prongJSON->FindMember (" excludePDGInHistory" )->value .GetArray ()) {
2469+ for (const auto & ii : prongJSON->FindMember (" excludePDGInHistory" )->value .GetArray ()) {
24262470 excludePDGInHistory.push_back (ii.GetBool ());
24272471 LOG (debug) << " excludePDGInHistory: " << ii.GetBool ();
24282472 }
0 commit comments