Retrieve basic parameters, mainly four-vectors, for each collection.
91 {
92
94
96
112
114 DataVect trackContKey; trackContKey.reserve(jetCont->
size());
115 DataVect trackLinkCount; trackLinkCount.reserve(jetCont->
size());
117
120
121 int id = 0;
122
124 for (const auto jet : *jetCont) {
125 if(!jet)continue;
126 ATH_MSG_DEBUG(
" Jet #" << counter++ <<
" : eta = " << jet->eta() <<
", phi = " << jet->phi() <<
", pt = " << jet->pt() );
127
128
130 std::vector<std::string> tempCellID;
131 size_t trackcounter = 0;
132
133 if (numConstit > 0){
134 const xAOD::IParticle* constituent = jet->rawConstituent(0);
135 if (constituent){
137
139
142 static_cast<const xAOD::PFO *
>(jet->rawConstituent(i));
145 trackKey.emplace_back(
DataType(thisTrack->index()));
147 trackcounter++;
148 }
149 }
151
155
156
160 if (thisTrack != nullptr) {
161 trackKey.emplace_back(
DataType(thisTrack->index()));
163 trackcounter++;
164 }
165 else
167 }
168 }
169 }
171
174 clusterID.emplace_back(
DataType(cluster->index()));
177 if (std::find(tempCellID.begin(), tempCellID.end(), std::to_string(
cc->caloDDE()->identify().get_compact())) != tempCellID.end()) {
178 continue;
179 } else {
180 cellID.emplace_back(
DataType(
cc->caloDDE()->identify().get_compact()));
181 tempCellID.emplace_back( std::to_string(
cc->caloDDE()->identify().get_compact()));
182 }
183 }
185 }
186
187 std::vector<const xAOD::TrackParticle*> ghosttracks;
189 if (ghosttracks.empty()) {
191 } else {
192 for (
size_t i = 0;
i < ghosttracks.size();
i++) {
193
194
195
196
199
200 ATH_MSG_VERBOSE(
" Associated track: d0 = " << ghosttracks[i]->
d0() <<
", pt = " << ghosttracks[i]->
pt());
201 }
202 trackcounter = ghosttracks.size();
203 }
208 if (!track) {
210 } else {
213 trackcounter++;
215 }
216 }
217 }
218 }
219 }
220 trackLinkCount.emplace_back(
DataType(trackcounter));
222
223
227 idVec.emplace_back(
DataType( ++
id ));
228
231
235
236
237 if (jetkey!=
"AntiKt4EMPFlowJets" || (
m_nTaggers==0)){
239 bTagName.emplace_back(
DataType(
"None"));
240 bTagValue.emplace_back(
DataType(0.));
241 }
242 }else{
243 double btagValue;
245 CP::CorrectionCode
code =
m_btagSelTools[taggerName]->getTaggerWeight(*jet, btagValue);
247 ATH_MSG_DEBUG(
"Failed to get btagging weight for tagger " << taggerName);
248 btagValue = 0;
249 }
250 bTagName.emplace_back(
DataType(taggerName));
251 bTagValue.emplace_back(
DataType(btagValue));
252 }
253 }
254
255 float chargeread;
259 }else{
261 }
262
263
264
265 std::vector<float> jvfread;
269 }else{
270 jvf.emplace_back(
DataType( jvfread[0] ));
271 }
272
273 float jvtread;
277 } else {
278 jvt.emplace_back(
DataType(jvtread));
279 }
280
281 float emfracread = 0;
284 emfrac.emplace_back(
DataType( 0. ));
285 }else{
286 emfrac.emplace_back(
DataType( emfracread ));
287 }
288
289 }
290
291
292 const std::size_t nphi =
phi.size();
296 DataMap[
"energy"] = std::move(energy);
297 DataMap[
"mass"] = std::move(mass);
299 DataMap[
"bTagName multiple=\""+str_nTaggers+
"\""] = std::move(bTagName);
300 DataMap[
"bTagValue multiple=\""+str_nTaggers+
"\""] = std::move(bTagValue);
302 DataMap[
"id"] = std::move(idVec);
306 DataMap[
"jvf"] = std::move(jvf);
307 DataMap[
"jvt"] = std::move(jvt);
308 DataMap[
"emfrac"] = std::move(emfrac);
309
310 if (!trackKey.empty()){
311 double NTracksPerVertex = trackKey.size()*1./jetCont->size();
312 std::string
tag =
"trackIndex multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
314 tag =
"trackKey multiple=\"" +
DataType(NTracksPerVertex).toString()+
"\"";
316 }
317
318 if (!clusterID.empty()){
319 std::string
tag =
"clusterIndex multiple=\"" +
DataType(clusterID.size()).toString()+
"\"";
320 double NCellsPerJet = cellID.size()*1./jetCont->size();
321 tag =
"cells multiple=\"" +
DataType(NCellsPerJet).toString()+
"\"";
323 }
324
325 DataMap[
"trackLinkCount"] = std::move(trackLinkCount);
326 DataMap[
"numCells"] = std::move(numCells);
327
329
331 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
double charge(const T &p)
float et(const xAOD::jFexSRJetRoI *j)
@ Ok
The correction was done successfully.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::string dataTypeName() const
Return the name of the data type that is generated by this retriever.
Gaudi::Property< std::vector< std::string > > m_bTaggerNames
std::unordered_map< std::string, asg::AnaToolHandle< IBTaggingSelectionTool > > m_btagSelTools
Gaudi::Property< std::string > m_tracksName
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
signal_t signalType() const
const xAOD::IParticle * chargedObject(std::size_t i) const
bool isCharged() const
is a charged PFO
const TrackParticle * track(unsigned int index) const
Retrieve a const pointer to a Rec::TrackParticle.
std::map< std::string, DataVect > DataMap
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ TrackParticle
The object is a charged track particle.
@ ParticleFlow
The object is a particle-flow object.
@ FlowElement
The object is a track-calo-cluster.
@ CaloCluster
The object is a calorimeter cluster.
PFO_v1 PFO
Definition of the current "pfo version".
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
FlowElement_v1 FlowElement
Definition of the current "pfo version".
TrackParticle_v1 TrackParticle
Reference the current persistent version: