Retrieve all the data.
41 return StatusCode::SUCCESS;
46 return StatusCode::SUCCESS;
48 int nTruth = truthCont->
size();
57 DataVect typeEV; typeEV.reserve(nTruth);
59 DataVect typeLabelStr; typeLabelStr.reserve(nTruth);
60 DataVect pdgId; pdgId.reserve(nTruth);
66 std::string truthLabels;
68 std::string typeLabel=
"n_a";
73 bool samePdgIdFlag =
false;
74 bool initialProcessFlag =
false;
75 bool protectedParticleFlag =
false;
77 for(; (mcpartItr != mcpartItrE) ; ++mcpartItr) {
78 samePdgIdFlag =
false;
79 initialProcessFlag =
false;
80 protectedParticleFlag =
false;
86 pdgId2 = (*mcpartItr)->pdgId();
89 if (( abs(pdgId2) == 24 ) || ( abs(pdgId2) == 5 ) ||
90 ( abs(pdgId2) == 6 ) || ( abs(pdgId2) == 23 ) ||
91 ( abs(pdgId2) == 36 ) || ( abs(pdgId2) == 37 ) ||
92 ( abs(pdgId2) == 25 ) ){
93 protectedParticleFlag =
true;
97 for (
unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
98 bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
99 if ( motherHasPdgId ){
100 motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
101 if ( motherPdgId == pdgId2 ){ samePdgIdFlag =
true; }
102 if (( abs(motherPdgId) == 24 ) || ( abs(motherPdgId) == 5 ) ||
103 ( abs(motherPdgId) == 6 ) || ( abs(motherPdgId) == 23 ) ||
104 ( abs(motherPdgId) == 36 ) || ( abs(motherPdgId) == 37 ) ||
105 ( abs(pdgId2) == 25 ) ){
106 initialProcessFlag =
true;
112 if ( !initialProcessFlag && !protectedParticleFlag ){
117 if ( samePdgIdFlag ){
130 pdgId.push_back(
DataType( pdgId2 ));
133 if( abs(pdgId2) == 11) typeLabel =
"Electron";
134 if( abs(pdgId2) == 12) typeLabel =
"NeutrinoElectron";
135 if( abs(pdgId2) == 13) typeLabel =
"Muon";
136 if( abs(pdgId2) == 14) typeLabel =
"NeutrinoMuon";
137 if( abs(pdgId2) == 15) typeLabel =
"Tau";
138 if( abs(pdgId2) == 16) typeLabel =
"NeutrinoTau";
139 if( pdgId2 == 6) typeLabel =
"Top";
140 if( pdgId2 == -6) typeLabel =
"AntiTop";
141 if( pdgId2 == 5) typeLabel =
"Bottom";
142 if( pdgId2 == -5) typeLabel =
"AntiBottom";
143 if( pdgId2 == 22) typeLabel =
"Photon";
144 if( pdgId2 == 23) typeLabel =
"Z0";
145 if( pdgId2 == 224) typeLabel =
"Wplus";
146 if( pdgId2 == -24) typeLabel =
"Wminus";
147 if( pdgId2 == 36) typeLabel =
"A0";
148 if( pdgId2 == 25) typeLabel =
"Higgs0";
149 if(( abs(pdgId2) >= 1) && ( abs(pdgId2) <= 4)) typeLabel =
"LightQuark";
151 typeEV.push_back(
DataType( typeLabel ) );
153 truthLabels =
"No" +
DataType( countTruth ).toString() +
"_Pdg="
154 +
DataType( (*mcpartItr)->pdgId() ).toString()
155 +
"_stat=" +
DataType( (*mcpartItr)->status() ).toString()
156 +
"_nParents=" +
DataType( (*mcpartItr)->nParents() ).toString()
157 +
"_nDecay=" +
DataType( (*mcpartItr)->nDecay() ).toString();
159 for (
unsigned int iChild = 0; iChild < (*mcpartItr)->nDecay(); ++iChild ) {
160 bool childHasPdgId = (*mcpartItr)->child(iChild)->hasPdgId();
161 if ( childHasPdgId ){
162 childPdgId = (*mcpartItr)->child(iChild)->pdgId();
163 truthLabels +=
"_CNo=" +
DataType(iChild+1).toString() +
"_CPdgId=" +
164 DataType( childPdgId ).toString() +
"_CET=" +
167 if (childPdgId == -11){
168 truthLabels +=
"_IntoElectron";
169 typeLabel +=
"_IntoElectron";
171 if (childPdgId == 11){
172 truthLabels +=
"_FromPositron";
173 typeLabel +=
"_FromPositron";
175 if (childPdgId == 13){
176 truthLabels +=
"_IntoMuonMinus";
177 typeLabel +=
"_IntoMuonMinus";
179 if (childPdgId == -13){
180 truthLabels +=
"_IntoMuonPlus";
181 typeLabel +=
"_IntoMuonPlus";
183 if (childPdgId == 15){
184 truthLabels +=
"_IntoTauMinus";
185 typeLabel +=
"_IntoTauMinus";
187 if (childPdgId == -15){
188 truthLabels +=
"_IntoTauPlus";
189 typeLabel +=
"_IntoTauPlus";
191 if (childPdgId == 5){
192 truthLabels +=
"_IntoBottom";
193 typeLabel +=
"_IntoBottom";
195 if (childPdgId == -5){
196 truthLabels +=
"_IntoAntiBottom";
197 typeLabel +=
"_IntoAntiBottom";
199 if (childPdgId == 6){
200 truthLabels +=
"_IntoTop";
201 typeLabel +=
"_IntoTop";
203 if (childPdgId == -6){
204 truthLabels +=
"_IntoAntiTop";
205 typeLabel +=
"_IntoAntiTop";
207 if ( ( abs(childPdgId) >= 1) && ( abs(childPdgId) <=4) ) {
208 truthLabels +=
"_IntoLightQuark";
209 typeLabel +=
"_IntoLightQuark";
211 if (childPdgId == -24){
212 truthLabels +=
"_IntoWminus";
213 typeLabel +=
"_IntoWminus";
215 if (childPdgId == 24){
216 truthLabels +=
"_IntoWplus";
217 typeLabel +=
"_IntoWplus";
219 if (childPdgId == 25){
220 truthLabels +=
"_IntoHiggs0";
221 typeLabel +=
"_IntoHiggs0";
223 if (childPdgId == 23){
224 truthLabels +=
"_IntoZ0";
225 typeLabel +=
"_IntoZ0";
229 for (
unsigned int iMother = 0; iMother < (*mcpartItr)->nParents(); ++iMother ) {
230 bool motherHasPdgId = (*mcpartItr)->mother(iMother)->hasPdgId();
231 if ( motherHasPdgId ){
232 int motherPdgId = (*mcpartItr)->mother(iMother)->pdgId();
233 truthLabels +=
"_MNo=" +
DataType(iMother+1).toString() +
"_MPdgId=" +
236 if (motherPdgId == -24){
237 truthLabels +=
"_FromWminus";
238 typeLabel +=
"_FromWminus";
240 if (motherPdgId == 24){
241 truthLabels +=
"_FromWplus";
242 typeLabel +=
"_FromWplus";
244 if (motherPdgId == 25){
245 truthLabels +=
"_FromHiggs0";
246 typeLabel +=
"_FromHiggs0";
248 if (motherPdgId == 23){
249 truthLabels +=
"_FromZ0";
250 typeLabel +=
"_FromZ0";
252 if (motherPdgId == 6){
253 truthLabels +=
"_FromTop";
254 typeLabel +=
"_FromTop";
256 if (motherPdgId == -6){
257 truthLabels +=
"_FromAntiTop";
258 typeLabel +=
"_FromAntiTop";
260 if (motherPdgId == 5){
261 truthLabels +=
"_FromBottom";
262 typeLabel +=
"_FromBottom";
264 if (motherPdgId == -5){
265 truthLabels +=
"_FromAntiBottom";
266 typeLabel +=
"_FromAntiBottom";
268 if (motherPdgId == 36){
269 truthLabels +=
"_FromA0";
270 typeLabel +=
"_FromA0";
272 if (motherPdgId == 37){
273 truthLabels +=
"_FromHiggsPlus";
274 typeLabel +=
"_FromHiggsPlus";
276 if (motherPdgId == -37){
277 truthLabels +=
"_FromHiggsMinus";
278 typeLabel +=
"_FromHiggsMinus";
290 myDataMap[
"pt"] =
pt;
291 myDataMap[
"phi"] =
phi;
292 myDataMap[
"eta"] =
eta;
293 myDataMap[
"typeEV"] = typeEV;
295 myDataMap[
"label"] = typeLabelStr;
296 myDataMap[
"pdgId"] = pdgId;