Retrieve basic parameters, mainly four-vectors, for each collection.
105 {
106
108
110
119
120 DataVect isTauString; isTauString.reserve(taucont->
size());
129 DataVect stripWidth; stripWidth.reserve(taucont->
size());
130 DataVect logLhRatio; logLhRatio.reserve(taucont->
size());
131
132
133
134
135 DataVect clusterKeyVec; clusterKeyVec.reserve(taucont->
size());
136 DataVect clusterIndexVec; clusterIndexVec.reserve(taucont->
size());
137 DataVect trackKeyVec; trackKeyVec.reserve(taucont->
size());
138 DataVect trackIndexVec; trackIndexVec.reserve(taucont->
size());
139 DataVect trackLinkCountVec; trackLinkCountVec.reserve(taucont->
size());
140
141
142
145
147 bool checkDataType=true;
148
149 if ( taujetItr != taujetItrE) {
150 dataType = (*taujetItr)->dataType();
153 }
154
155 if(checkDataType){
156 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
" TauJet Datatype: Full Sim " <<
endmsg;
157 }else{
158 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
" TauJet Datatype: Fast Sim " <<
endmsg;
159 }
160
161
162 unsigned int countTrackLinks = 0;
163 unsigned int numTauJets = 0;
164 std::string numTracksPerTaujet = "";
165 std::string trackKeyString = "trackKey";
166 std::string trackIndexString = "trackIndex";
167
168 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
" Number of TauJets: " << taucont->
size() <<
endmsg;
170 for (; taujetItr != taujetItrE; ++taujetItr) {
171 const ElementLinkVector<Rec::TrackParticleContainer> myTrackLinkVector = (*taujetItr)->trackLinkVector();
172 countTrackLinks += myTrackLinkVector.
size();
173 numTauJets++;
174 }
175 if ( numTauJets == 0 ){
176 numTracksPerTaujet = "0";
177 } else {
178 numTracksPerTaujet =
DataType( countTrackLinks/((
double) numTauJets )).toString();
179 }
180 trackKeyString = "trackKey multiple=\""+numTracksPerTaujet+"\"";
181 trackIndexString = "trackIndex multiple=\""+numTracksPerTaujet+"\"";
182 }
183
184 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
" trackKeyString: " << trackKeyString <<
185 " trackIndexString: " << trackIndexString <<
endmsg;
186
187 std::string labelStr = "none";
188 std::string isTauStr = "none";
189 int id=0;
190 taujetItr = taucont->
begin();
191 for (; taujetItr != taujetItrE; ++taujetItr) {
192
193 pt.push_back( JiveXML::DataType((*taujetItr)->pt()/CLHEP::GeV ) );
194 phi.push_back( JiveXML::DataType((*taujetItr)->phi() ) );
195 eta.push_back( JiveXML::DataType((*taujetItr)->eta() ) );
196 px.push_back( JiveXML::DataType((*taujetItr)->px()/CLHEP::GeV ) );
197 py.push_back( JiveXML::DataType((*taujetItr)->py()/CLHEP::GeV ) );
198 pz.push_back( JiveXML::DataType((*taujetItr)->pz()/CLHEP::GeV ) );
199 energy.push_back( JiveXML::DataType((*taujetItr)->m()/CLHEP::GeV ) );
200 mass.push_back( JiveXML::DataType((*taujetItr)->e()/CLHEP::GeV ) );
201
203
204 std::string taujetAuthor = "none";
205 if (( (*taujetItr)->author()) == 0){ taujetAuthor = "default"; }
206 if (( (*taujetItr)->author()) == 1){ taujetAuthor = "tauRec"; }
207 if (( (*taujetItr)->author()) == 2){ taujetAuthor = "tau1P3P"; }
208 author.push_back( JiveXML::DataType( taujetAuthor ) );
209
210 labelStr = taujetAuthor;
211
212 numTracks.push_back( JiveXML::DataType( (*taujetItr)->numTrack() ) );
213 charge.push_back( JiveXML::DataType((*taujetItr)->charge() ) );
214
215 isTauStr = "none";
216
217
218
220 isTauStr = "TauLlhLoose"; labelStr += "_TauLlhLoose";}
222 isTauStr = "TauLlhMedium"; labelStr += "_TauLlhMedium";}
224 isTauStr = "TauLlhTight"; labelStr += "_TauLlhTight";}
226 isTauStr = "TauCutLoose"; labelStr += "_TauCutLoose";}
228 isTauStr = "TauCutMedium"; labelStr += "_TauCutMedium";}
230 isTauStr = "TauCutTight"; labelStr += "_TauCutTight"; }
231 if (
msgLvl(MSG::DEBUG))
msg(MSG::DEBUG) <<
" TauJet # " << (++
id)
232 <<
", label:" << labelStr <<
endmsg;
233 isTauString.push_back (isTauStr);
234 label.push_back( labelStr );
235
236 etEMCalib.push_back( JiveXML::DataType( 0. ) );
237 etHadCalib.push_back( JiveXML::DataType( 0. ) );
238 emRadius.push_back( JiveXML::DataType( 0. ) );
239 isolFrac.push_back( JiveXML::DataType( 0. ) );
240 stripWidth.push_back( JiveXML::DataType( 0. ) );
241 logLhRatio.push_back( JiveXML::DataType( 0. ) );
242
243
244
245
246
247
248
249
250
251
252 const ElementLink<CaloClusterContainer> clusterLink = (*taujetItr)->clusterLink();
254 std::string clusterKey = clusterLink.
dataID();
255 int clusterIndex = clusterLink.
index();
256 clusterKeyVec.push_back(
DataType( clusterKey ));
257 clusterIndexVec.push_back(
DataType( clusterIndex));
258 } else {
259 clusterKeyVec.push_back(
DataType(
"none" ));
260 clusterIndexVec.push_back(
DataType( -1 ));
261 }
262
263
264 const ElementLinkVector<Rec::TrackParticleContainer> myTrackLinkVector = (*taujetItr)->trackLinkVector();
265
266 unsigned int trackLinkCount = myTrackLinkVector.
size();
267 trackLinkCountVec.push_back(
DataType( trackLinkCount ));
268
269 if (trackLinkCount > 0){
270 for (
unsigned int i=0;
i<trackLinkCount; ++
i){
271
272 const ElementLink<Rec::TrackParticleContainer> trackParticleLink = myTrackLinkVector.
at(i);
273 std::string trackKey = trackParticleLink.
dataID();
274 int trackIndex = trackParticleLink.
index();
275 if ( trackParticleLink.
isValid()){
276
277
278
279 trackKeyVec.push_back(
DataType( trackKey ));
280 trackIndexVec.push_back(
DataType( trackIndex));
281 } else {
282 trackKeyVec.push_back(
DataType(
"none" ));
283 trackIndexVec.push_back(
DataType( -1 ));
284 }
285 }
286 }
287 } else {
288
289 std::string numTracksEmpty = "0";
290 author.push_back( JiveXML::DataType(
"atlfast" ) );
291 numTracks.push_back( JiveXML::DataType( "1" ));
292 charge.push_back( JiveXML::DataType( 1. ) );
293 etEMCalib.push_back( JiveXML::DataType( 0. ) );
294 etHadCalib.push_back( JiveXML::DataType( 0. ) );
295 emRadius.push_back( JiveXML::DataType( 0. ) );
296 isolFrac.push_back( JiveXML::DataType( 0. ) );
297 stripWidth.push_back( JiveXML::DataType( 0. ) );
298 logLhRatio.push_back( JiveXML::DataType( 0. ) );
299 isTauString.push_back( JiveXML::DataType( "fastSim" ) );
300 label.push_back( JiveXML::DataType(
"atlfast" ) );
301
302 clusterKeyVec.push_back(
DataType(
"none" ));
303 clusterIndexVec.push_back(
DataType( -1 ));
304 trackKeyVec.push_back(
DataType(
"none" ));
305 trackIndexVec.push_back(
DataType( -1 ));
306 trackLinkCountVec.push_back(
DataType( -1 ));
307 }
308 }
309
310
319
320
321 DataMap[
"isTauString"] = isTauString;
323 DataMap[
"numTracks"] = numTracks;
330 DataMap[
"stripWidth"] = stripWidth;
331 DataMap[
"logLhRatio"] = logLhRatio;
332
333
334 DataMap[
"clusterKey"] = clusterKeyVec;
335 DataMap[
"clusterIndex"] = clusterIndexVec;
336 DataMap[trackKeyString] = trackKeyVec;
337 DataMap[trackIndexString] = trackIndexVec;
338 DataMap[
"trackLinkCount"] = trackLinkCountVec;
339
342 }
343
344
346
347 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double charge(const T &p)
bool msgLvl(const MSG::Level lvl) const
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_reference at(size_type n) const
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.
std::string label(const std::string &format, int i)
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
@ isolFrac
Get isolation fraction.