7 #include "CLHEP/Units/SystemOfUnits.h"
13 #include "CaloEvent/CaloClusterContainer.h"
25 m_typeName(
"Electron"){
28 declareInterface<IDataRetriever>(
this);
31 "Collection to be first in output, shown in Atlantis without switching");
48 if (
sc.isFailure() ) {
76 return StatusCode::SUCCESS;
89 const auto nElectrons = elCont->
size();
91 DataVect phi; phi.reserve(nElectrons);
92 DataVect eta; eta.reserve(nElectrons);
99 DataVect eOverp; eOverp.reserve(nElectrons);
100 DataVect isEM; isEM.reserve(nElectrons);
101 DataVect isEMString; isEMString.reserve(nElectrons);
102 DataVect hasTrack; hasTrack.reserve(nElectrons);
106 DataVect pdgId; pdgId.reserve(nElectrons);
108 DataVect hitsBLayer; hitsBLayer.reserve(nElectrons);
109 DataVect hitsPixel; hitsPixel.reserve(nElectrons);
110 DataVect hitsSCT; hitsSCT.reserve(nElectrons);
111 DataVect hitsTRT; hitsTRT.reserve(nElectrons);
114 DataVect clusterKeyVec; clusterKeyVec.reserve(nElectrons);
115 DataVect clusterIndexVec; clusterIndexVec.reserve(nElectrons);
116 DataVect trackKeyVec; trackKeyVec.reserve(nElectrons);
117 DataVect trackIndexVec; trackIndexVec.reserve(nElectrons);
127 double ep = 0.,
p=0.,
e=0.;
129 std::string electronAuthor =
"";
130 std::string electronIsEMString =
"none";
131 std::string electronLabel =
"";
133 for (; elItr != elItrE; ++elItr) {
134 electronIsEMString =
"none";
135 phi.emplace_back((*elItr)->phi());
136 eta.emplace_back((*elItr)->eta());
145 pdgId.emplace_back( (*elItr)->pdgId() );
147 electronAuthor =
"author"+
DataType( (*elItr)->author() ).toString();
148 electronLabel = electronAuthor;
149 if (( (*elItr)->author()) == 0){ electronAuthor =
"unknown"; electronLabel +=
"_unknown"; }
150 if (( (*elItr)->author()) == 8){ electronAuthor =
"forward"; electronLabel +=
"_forward"; }
151 if (( (*elItr)->author()) == 2){ electronAuthor =
"softe"; electronLabel +=
"_softe"; }
152 if (( (*elItr)->author()) == 1){ electronAuthor =
"egamma"; electronLabel +=
"_egamma"; }
159 electronLabel +=
"_Loose";
160 electronIsEMString =
"Loose";
163 electronLabel +=
"_Medium";
164 electronIsEMString =
"Medium";
167 electronLabel +=
"_Tight";
168 electronIsEMString =
"Tight";
171 electronLabel +=
"_TightPP";
172 electronIsEMString =
"TightPP";
175 electronLabel +=
"_MediumPP";
180 electronLabel +=
"_MediumNoIso";
184 electronLabel +=
"_TightTRTNoIso";
189 electronLabel +=
"_TightNoIsolation";
192 MCdataType = (*elItr)->dataType();
193 dataType.emplace_back( MCdataType );
199 if (MCdataType != 3){
201 isEM.emplace_back( (**elItr).isem() );
204 bool elecTrack = (*elItr)->trackParticle();
212 p = (*elItr)->trackParticle()->p();
214 ep =
p>0. ?
e/
p : 0.;
215 eOverp.emplace_back( ep );
217 summary = (*elItr)->trackParticle()->trackSummary();
218 hasTrack.emplace_back( 1 );
224 eOverp.emplace_back(
DataType(
"0." ));
225 hasTrack.emplace_back( 0 );
226 hitsBLayer.emplace_back( -1 );
227 hitsPixel.emplace_back( -1 );
228 hitsSCT.emplace_back( -1 );
229 hitsTRT.emplace_back( -1 );
239 std::string clusterKey = clusterLink.
dataID();
240 int clusterIndex = clusterLink.
index();
243 clusterKeyVec.emplace_back( clusterKey );
244 clusterIndexVec.emplace_back( clusterIndex );
246 clusterKeyVec.emplace_back(
"none" );
247 clusterIndexVec.emplace_back( -1 );
252 std::string trackKey = trackLink.
dataID();
253 int trackIndex = trackLink.
index();
256 trackKeyVec.emplace_back( trackKey );
257 trackIndexVec.emplace_back( trackIndex);
259 trackKeyVec.emplace_back(
"none" );
260 trackIndexVec.emplace_back( -1 );
268 hasTrack.emplace_back( 1 );
269 eOverp.emplace_back( 1. );
270 isEM.emplace_back( 0 );
271 electronIsEMString +=
"fastSim";
272 electronLabel +=
"fastSim" ;
273 hitsBLayer.emplace_back( 0 );
274 hitsPixel.emplace_back( 0 );
275 hitsSCT.emplace_back( 0 );
276 hitsTRT.emplace_back( 0 );
278 clusterKeyVec.emplace_back(
"none" );
279 clusterIndexVec.emplace_back( -1 );
280 trackKeyVec.emplace_back(
"none" );
281 trackIndexVec.emplace_back( -1 );
284 author.emplace_back( electronAuthor );
285 label.emplace_back( electronLabel );
286 isEMString.emplace_back( electronIsEMString );
291 DataMap[
"phi"] = std::move(phi);
292 DataMap[
"eta"] = std::move(eta);
301 DataMap[
"eOverp"] = std::move(eOverp);
302 DataMap[
"isEM"] = std::move(isEM);
303 DataMap[
"isEMString"] = std::move(isEMString);
305 DataMap[
"hasTrack"] = std::move(hasTrack);
307 DataMap[
"pdgId"] = std::move(pdgId);
309 DataMap[
"hitsBLayer"] = std::move(hitsBLayer);
310 DataMap[
"hitsPixel"] = std::move(hitsPixel);
311 DataMap[
"hitsSCT"] = std::move(hitsSCT);
312 DataMap[
"hitsTRT"] = std::move(hitsTRT);
315 DataMap[
"clusterKey"] = std::move(clusterKeyVec);
316 DataMap[
"clusterIndex"] = std::move(clusterIndexVec);
317 DataMap[
"trackKey"] = std::move(trackKeyVec);
318 DataMap[
"trackIndex"] = std::move(trackIndexVec);