Retrieve all the data.
39 return StatusCode::SUCCESS;
44 return StatusCode::SUCCESS;
46 int nTruth = truthCont->
size();
55 DataVect typeEV; typeEV.reserve(nTruth);
57 DataVect typeLabelStr; typeLabelStr.reserve(nTruth);
64 std::string truthLabels;
66 std::string typeLabel=
"n_a";
71 bool samePdgIdFlag =
false;
72 bool initialProcessFlag =
false;
73 bool protectedParticleFlag =
false;
75 for(; (mcpartItr != mcpartItrE) ; ++mcpartItr) {
76 samePdgIdFlag =
false;
77 initialProcessFlag =
false;
78 protectedParticleFlag =
false;
84 pdgId2 = (*mcpartItr)->pdgId();
87 if (( abs(pdgId2) == 24 ) || ( abs(pdgId2) == 5 ) ||
88 ( abs(pdgId2) == 6 ) || ( abs(pdgId2) == 23 ) ||
89 ( abs(pdgId2) == 36 ) || ( abs(pdgId2) == 37 ) ||
90 ( abs(pdgId2) == 25 ) ){
91 protectedParticleFlag =
true;
95 for (
unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
96 bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
97 if ( motherHasPdgId ){
98 motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
99 if ( motherPdgId == pdgId2 ){ samePdgIdFlag =
true; }
100 if (( abs(motherPdgId) == 24 ) || ( abs(motherPdgId) == 5 ) ||
101 ( abs(motherPdgId) == 6 ) || ( abs(motherPdgId) == 23 ) ||
102 ( abs(motherPdgId) == 36 ) || ( abs(motherPdgId) == 37 ) ||
103 ( abs(pdgId2) == 25 ) ){
104 initialProcessFlag =
true;
110 if ( !initialProcessFlag && !protectedParticleFlag ){
115 if ( samePdgIdFlag ){
131 if( abs(pdgId2) == 11) typeLabel =
"Electron";
132 if( abs(pdgId2) == 12) typeLabel =
"NeutrinoElectron";
133 if( abs(pdgId2) == 13) typeLabel =
"Muon";
134 if( abs(pdgId2) == 14) typeLabel =
"NeutrinoMuon";
135 if( abs(pdgId2) == 15) typeLabel =
"Tau";
136 if( abs(pdgId2) == 16) typeLabel =
"NeutrinoTau";
137 if( pdgId2 == 6) typeLabel =
"Top";
138 if( pdgId2 == -6) typeLabel =
"AntiTop";
139 if( pdgId2 == 5) typeLabel =
"Bottom";
140 if( pdgId2 == -5) typeLabel =
"AntiBottom";
141 if( pdgId2 == 22) typeLabel =
"Photon";
142 if( pdgId2 == 23) typeLabel =
"Z0";
143 if( pdgId2 == 224) typeLabel =
"Wplus";
144 if( pdgId2 == -24) typeLabel =
"Wminus";
145 if( pdgId2 == 36) typeLabel =
"A0";
146 if( pdgId2 == 25) typeLabel =
"Higgs0";
147 if(( abs(pdgId2) >= 1) && ( abs(pdgId2) <= 4)) typeLabel =
"LightQuark";
149 typeEV.push_back(
DataType( typeLabel ) );
151 truthLabels =
"No" +
DataType( countTruth ).toString() +
"_Pdg="
152 +
DataType( (*mcpartItr)->pdgId() ).toString()
153 +
"_stat=" +
DataType( (*mcpartItr)->status() ).toString()
154 +
"_nParents=" +
DataType( (*mcpartItr)->nParents() ).toString()
155 +
"_nDecay=" +
DataType( (*mcpartItr)->nDecay() ).toString();
157 for (
unsigned int iChild = 0; iChild < (*mcpartItr)->nDecay(); ++iChild ) {
158 bool childHasPdgId = (*mcpartItr)->child(iChild)->hasPdgId();
159 if ( childHasPdgId ){
160 childPdgId = (*mcpartItr)->child(iChild)->pdgId();
161 truthLabels +=
"_CNo=" +
DataType(iChild+1).toString() +
"_CPdgId=" +
162 DataType( childPdgId ).toString() +
"_CET=" +
165 if (childPdgId == -11){
166 truthLabels +=
"_IntoElectron";
167 typeLabel +=
"_IntoElectron";
169 if (childPdgId == 11){
170 truthLabels +=
"_FromPositron";
171 typeLabel +=
"_FromPositron";
173 if (childPdgId == 13){
174 truthLabels +=
"_IntoMuonMinus";
175 typeLabel +=
"_IntoMuonMinus";
177 if (childPdgId == -13){
178 truthLabels +=
"_IntoMuonPlus";
179 typeLabel +=
"_IntoMuonPlus";
181 if (childPdgId == 15){
182 truthLabels +=
"_IntoTauMinus";
183 typeLabel +=
"_IntoTauMinus";
185 if (childPdgId == -15){
186 truthLabels +=
"_IntoTauPlus";
187 typeLabel +=
"_IntoTauPlus";
189 if (childPdgId == 5){
190 truthLabels +=
"_IntoBottom";
191 typeLabel +=
"_IntoBottom";
193 if (childPdgId == -5){
194 truthLabels +=
"_IntoAntiBottom";
195 typeLabel +=
"_IntoAntiBottom";
197 if (childPdgId == 6){
198 truthLabels +=
"_IntoTop";
199 typeLabel +=
"_IntoTop";
201 if (childPdgId == -6){
202 truthLabels +=
"_IntoAntiTop";
203 typeLabel +=
"_IntoAntiTop";
205 if ( ( abs(childPdgId) >= 1) && ( abs(childPdgId) <=4) ) {
206 truthLabels +=
"_IntoLightQuark";
207 typeLabel +=
"_IntoLightQuark";
209 if (childPdgId == -24){
210 truthLabels +=
"_IntoWminus";
211 typeLabel +=
"_IntoWminus";
213 if (childPdgId == 24){
214 truthLabels +=
"_IntoWplus";
215 typeLabel +=
"_IntoWplus";
217 if (childPdgId == 25){
218 truthLabels +=
"_IntoHiggs0";
219 typeLabel +=
"_IntoHiggs0";
221 if (childPdgId == 23){
222 truthLabels +=
"_IntoZ0";
223 typeLabel +=
"_IntoZ0";
227 for (
unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
228 bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
229 if ( motherHasPdgId ){
230 int motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
231 truthLabels +=
"_MNo=" +
DataType(iMother+1).toString() +
"_MPdgId=" +
234 if (motherPdgId == -24){
235 truthLabels +=
"_FromWminus";
236 typeLabel +=
"_FromWminus";
238 if (motherPdgId == 24){
239 truthLabels +=
"_FromWplus";
240 typeLabel +=
"_FromWplus";
242 if (motherPdgId == 25){
243 truthLabels +=
"_FromHiggs0";
244 typeLabel +=
"_FromHiggs0";
246 if (motherPdgId == 23){
247 truthLabels +=
"_FromZ0";
248 typeLabel +=
"_FromZ0";
250 if (motherPdgId == 6){
251 truthLabels +=
"_FromTop";
252 typeLabel +=
"_FromTop";
254 if (motherPdgId == -6){
255 truthLabels +=
"_FromAntiTop";
256 typeLabel +=
"_FromAntiTop";
258 if (motherPdgId == 5){
259 truthLabels +=
"_FromBottom";
260 typeLabel +=
"_FromBottom";
262 if (motherPdgId == -5){
263 truthLabels +=
"_FromAntiBottom";
264 typeLabel +=
"_FromAntiBottom";
266 if (motherPdgId == 36){
267 truthLabels +=
"_FromA0";
268 typeLabel +=
"_FromA0";
270 if (motherPdgId == 37){
271 truthLabels +=
"_FromHiggsPlus";
272 typeLabel +=
"_FromHiggsPlus";
274 if (motherPdgId == -37){
275 truthLabels +=
"_FromHiggsMinus";
276 typeLabel +=
"_FromHiggsMinus";
288 const auto n =
phi.size();
289 myDataMap[
"pt"] = std::move(
pt);
290 myDataMap[
"phi"] = std::move(
phi);
291 myDataMap[
"eta"] = std::move(
eta);
292 myDataMap[
"typeEV"] = std::move(typeEV);
293 myDataMap[
"label"] = std::move(typeLabelStr);
294 myDataMap[
"pdgId"] = std::move(
pdgId);
295 myDataMap[
"dataType"] = std::move(
dataType);