Retrieve basic parameters, mainly four-vectors, for each collection.
88 {
89
91
93
102
106 DataVect etConeIsol; etConeIsol.reserve(muoncont->
size());
108
109
110 DataVect clusterKeyVec; clusterKeyVec.reserve(muoncont->
size());
111 DataVect clusterIndexVec; clusterIndexVec.reserve(muoncont->
size());
112 DataVect trackKeyVec; trackKeyVec.reserve(muoncont->
size());
113 DataVect trackIndexVec; trackIndexVec.reserve(muoncont->
size());
114
117
118 int MCdataType = 1;
119 std::string clusterKey = "none";
120 int clusterIndex = -1;
121 std::string trackKey = "none";
122 int trackIndex = -1;
123
124 for (; muonItr != muonItrE; ++muonItr) {
125 phi.emplace_back((*muonItr)->phi());
126 eta.emplace_back((*muonItr)->eta());
127 pt.emplace_back((*muonItr)->pt()/CLHEP::GeV);
128 mass.emplace_back((*muonItr)->m()/CLHEP::GeV);
129 energy.emplace_back( (*muonItr)->e()/CLHEP::GeV );
130 px.emplace_back( (*muonItr)->px()/CLHEP::GeV );
131 py.emplace_back( (*muonItr)->py()/CLHEP::GeV );
132 pz.emplace_back( (*muonItr)->pz()/CLHEP::GeV );
133
134 pdgId.emplace_back( (*muonItr)->pdgId() );
135
136 std::string muonAuthor = "none";
137 if (( (*muonItr)->author()) == 0){ muonAuthor = "unknown"; }
138 if (( (*muonItr)->author()) == 1){ muonAuthor = "highpt"; }
139 if (( (*muonItr)->author()) == 2){ muonAuthor = "lowpt"; }
140 author.emplace_back( muonAuthor );
141
142 MCdataType = (*muonItr)->dataType();
143 dataType.emplace_back( MCdataType );
144
145
146
147
148 if (MCdataType != 3){
149 chi2.emplace_back( (*muonItr)->matchChi2OverDoF() );
150 etConeIsol.emplace_back(
152
153
154
155
157 " Muon: matchChi2OverDoF: " << (*muonItr)->matchChi2OverDoF() <<
158 ", matchChi2: " << (*muonItr)->matchChi2() <<
159 ", fitChi2: " << (*muonItr)->fitChi2() <<
160 ", isCombined: " << (int)(*muonItr)->isCombinedMuon() );
161
162
163
164
165
166
167 const ElementLink<Rec::TrackParticleContainer> trackLink = (*muonItr)->inDetTrackLink();
169 trackKey = trackLink.
dataID();
170 trackIndex = trackLink.
index();
171 trackKeyVec.emplace_back( trackKey );
172 trackIndexVec.emplace_back( trackIndex );
173 } else {
174 trackKeyVec.emplace_back( "none" );
175 trackIndexVec.emplace_back( -1 );
176 }
177 const ElementLink<CaloClusterContainer> clusterLink = (*muonItr)->clusterLink();
179 clusterKey = clusterLink.
dataID();
180 clusterIndex = clusterLink.
index();
181 clusterKeyVec.emplace_back( clusterKey );
182 clusterIndexVec.emplace_back( clusterIndex );
183 } else {
184 clusterKeyVec.emplace_back( "none" );
185 clusterIndexVec.emplace_back( -1 );
186 }
187
188 } else {
189 chi2.emplace_back( 0 );
190 etConeIsol.emplace_back( 0 );
191 trackKeyVec.emplace_back( "none" );
192 trackIndexVec.emplace_back( -1 );
193 clusterKeyVec.emplace_back( "none");
194 clusterIndexVec.emplace_back( -1 );
195 }
196 }
197
202 DataMap[
"energy"] = std::move(energy);
203 DataMap[
"mass"] = std::move(mass);
207
208
210 DataMap[
"etConeIsol"] = std::move(etConeIsol);
211 DataMap[
"author"] = std::move(author);
212 DataMap[
"pdgId"] = std::move(pdgId);
213 DataMap[
"dataType"] = std::move(dataType);
214
215 DataMap[
"clusterKey"] = std::move(clusterKeyVec);
216 DataMap[
"clusterIndex"] = std::move(clusterIndexVec);
217 DataMap[
"trackKey"] = std::move(trackKeyVec);
218 DataMap[
"trackIndex"] = std::move(trackIndexVec);
219
221
222
224
225 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
const ID_type & dataID() const
Get the key that we reference, as a string.
index_type index() const
Get the index of the element inside of its container.
bool isValid() const
Test to see if the link can be dereferenced.
virtual std::string dataTypeName() const
Return the name of the data type.
double chi2(TH1 *h0, TH1 *h1)
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.