Skip to content

Commit fa3cc1a

Browse files
committed
Use edm4hep::TrackerHit3D instead of edm4hep::TrackerHit
1 parent e65c864 commit fa3cc1a

File tree

113 files changed

+963
-557
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+963
-557
lines changed

Analysis/TrackInspect/src/TrackInspectAlg.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ StatusCode TrackInspectAlg::execute(){
136136
for (auto relCol: relCols) {
137137
if (relCol){
138138
for (auto rel: *relCol){
139-
std::pair<edm4hep::TrackerHit, edm4hep::MCParticle> p = std::make_pair(rel.getRec(), rel.getSim().getMCParticle());
139+
std::pair<edm4hep::TrackerHit3D, edm4hep::MCParticle> p = std::make_pair(rel.getRec(), rel.getSim().getMCParticle());
140140
if (hitmap.find(p) == hitmap.end()) hitmap[p] = 0.;
141141
hitmap[p] += rel.getWeight();
142142
}
@@ -212,9 +212,9 @@ double TrackInspectAlg::match(edm4hep::MCParticle particle, edm4hep::Track track
212212
double matchedHits = 0;
213213
double usedHits = 0;
214214
for (int i = 0; i < NHits; i++) {
215-
edm4hep::TrackerHit hit = track.getTrackerHits(i);
215+
edm4hep::TrackerHit3D hit = track.getTrackerHits(i);
216216
usedHits++;
217-
std::pair<edm4hep::TrackerHit, edm4hep::MCParticle> ele = std::make_pair(hit, particle);
217+
std::pair<edm4hep::TrackerHit3D, edm4hep::MCParticle> ele = std::make_pair(hit, particle);
218218
//std::cout << "lookup --> " << ele.first << std::endl;
219219
//if (hitmap.find(ele) != hitmap.end() ) {
220220
//std::cout << "find --> " << hitmap[ele] << std::endl;

Analysis/TrackInspect/src/TrackInspectAlg.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,25 @@
55
#include "GaudiKernel/Algorithm.h"
66

77
#include "edm4hep/TrackCollection.h"
8+
#if __has_include("edm4hep/TrackerHit3D.h")
9+
#include "edm4hep/TrackerHit3D.h"
10+
#else
811
#include "edm4hep/TrackerHit.h"
12+
namespace edm4hep {
13+
using TrackerHit3D = edm4hep::TrackerHit;
14+
} // namespace edm4hep
15+
#endif
916
#include "edm4hep/MCParticle.h"
1017
#include "edm4hep/MCParticleCollection.h"
1118
#include "edm4hep/SimTrackerHitCollection.h"
19+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
20+
#include "edm4hep/TrackerHit3DCollection.h"
21+
#else
1222
#include "edm4hep/TrackerHitCollection.h"
23+
namespace edm4hep {
24+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
25+
} // namespace edm4hep
26+
#endif
1327
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
1428

1529
#include "GaudiKernel/NTuple.h"
@@ -42,7 +56,7 @@ class TrackInspectAlg : public Algorithm {
4256
Gaudi::Property<bool> _useSET{this, "useSET", true};
4357
Gaudi::Property<bool> _useFTD{this, "useFTD", true};
4458

45-
std::map<std::pair<edm4hep::TrackerHit, edm4hep::MCParticle>, double> hitmap;
59+
std::map<std::pair<edm4hep::TrackerHit3D, edm4hep::MCParticle>, double> hitmap;
4660
std::vector<std::tuple<edm4hep::MCParticle, edm4hep::Track, double>> matchvec;
4761
double match(edm4hep::MCParticle, edm4hep::Track);
4862

Digitisers/DCHDigi/src/DCHDigiAlg.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ StatusCode DCHDigiAlg::execute()
107107

108108
info() << "Processing " << _nEvt << " events " << endmsg;
109109
if(m_WriteAna) m_evt = _nEvt;
110-
edm4hep::TrackerHitCollection* Vec = w_DigiDCHCol.createAndPut();
110+
edm4hep::TrackerHit3DCollection* Vec = w_DigiDCHCol.createAndPut();
111111
edm4hep::MCRecoTrackerAssociationCollection* AssoVec = w_AssociationCol.createAndPut();
112112
const edm4hep::SimTrackerHitCollection* SimHitCol = r_SimDCHCol.get();
113113
if (SimHitCol->size() == 0) {

Digitisers/DCHDigi/src/DCHDigiAlg.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
#include "GaudiKernel/NTuple.h"
66
#include "GaudiAlg/GaudiAlgorithm.h"
77
#include "edm4hep/SimTrackerHitCollection.h"
8+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
9+
#include "edm4hep/TrackerHit3DCollection.h"
10+
#else
811
#include "edm4hep/TrackerHitCollection.h"
12+
namespace edm4hep {
13+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
14+
} // namespace edm4hep
15+
#endif
916
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
1017
#include "edm4hep/MCParticle.h"
1118

@@ -102,7 +109,7 @@ class DCHDigiAlg : public GaudiAlgorithm
102109
// Input collections
103110
DataHandle<edm4hep::SimTrackerHitCollection> r_SimDCHCol{"DriftChamberHitsCollection", Gaudi::DataHandle::Reader, this};
104111
// Output collections
105-
DataHandle<edm4hep::TrackerHitCollection> w_DigiDCHCol{"DigiDCHitCollection", Gaudi::DataHandle::Writer, this};
112+
DataHandle<edm4hep::TrackerHit3DCollection> w_DigiDCHCol{"DigiDCHitCollection", Gaudi::DataHandle::Writer, this};
106113
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> w_AssociationCol{"DCHitAssociationCollection", Gaudi::DataHandle::Writer, this};
107114
};
108115

Digitisers/SimpleDigi/src/CylinderDigiAlg.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55
#include "GaudiKernel/NTuple.h"
66
#include "GaudiAlg/GaudiAlgorithm.h"
77
#include "edm4hep/SimTrackerHitCollection.h"
8+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
9+
#include "edm4hep/TrackerHit3DCollection.h"
10+
#else
811
#include "edm4hep/TrackerHitCollection.h"
12+
namespace edm4hep {
13+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
14+
} // namespace edm4hep
15+
#endif
916
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
1017

1118
#include <DDRec/DetectorData.h>
@@ -28,7 +35,7 @@ class CylinderDigiAlg : public GaudiAlgorithm{
2835
// Input collections
2936
DataHandle<edm4hep::SimTrackerHitCollection> m_inputColHdls{"DriftChamberHitsCollection", Gaudi::DataHandle::Reader, this};
3037
// Output collections
31-
DataHandle<edm4hep::TrackerHitCollection> m_outputColHdls{"DCTrackerHits", Gaudi::DataHandle::Writer, this};
38+
DataHandle<edm4hep::TrackerHit3DCollection> m_outputColHdls{"DCTrackerHits", Gaudi::DataHandle::Writer, this};
3239
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> m_assColHdls{"DCTrackerHitAssociationCollection", Gaudi::DataHandle::Writer, this};
3340

3441
Gaudi::Property<float> m_resRPhi{this, "ResRPhi", 0.1};

Digitisers/SimpleDigi/src/PlanarDigiAlg.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
#include <gsl/gsl_rng.h>
77
#include "edm4hep/EventHeaderCollection.h"
88
#include "edm4hep/SimTrackerHitCollection.h"
9+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
10+
#include "edm4hep/TrackerHit3DCollection.h"
11+
#else
912
#include "edm4hep/TrackerHitCollection.h"
13+
namespace edm4hep {
14+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
15+
} // namespace edm4hep
16+
#endif
1017
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
1118

1219
/** ======= PlanarDigiProcessor / PlanarDigiAlg ========== <br>
@@ -92,7 +99,7 @@ class PlanarDigiAlg : public GaudiAlgorithm
9299
DataHandle<edm4hep::EventHeaderCollection> _headerCol{"EventHeaderCol", Gaudi::DataHandle::Reader, this};
93100
DataHandle<edm4hep::SimTrackerHitCollection> _inColHdl{"VXDCollection", Gaudi::DataHandle::Reader, this};
94101
// Output collections
95-
DataHandle<edm4hep::TrackerHitCollection> _outColHdl{"VXDTrackerHits", Gaudi::DataHandle::Writer, this};
102+
DataHandle<edm4hep::TrackerHit3DCollection> _outColHdl{"VXDTrackerHits", Gaudi::DataHandle::Writer, this};
96103
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _outRelColHdl{"VXDTrackerHitRelations", Gaudi::DataHandle::Writer, this};
97104
};
98105

Digitisers/SimpleDigi/src/TPCDigiAlg.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ Steve Aplin 26 June 2009 (DESY)
2323
#include "k4FWCore/DataHandle.h"
2424
#include "edm4hep/EventHeaderCollection.h"
2525
#include "edm4hep/SimTrackerHitCollection.h"
26+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
27+
#include "edm4hep/TrackerHit3DCollection.h"
28+
#else
2629
#include "edm4hep/TrackerHitCollection.h"
30+
namespace edm4hep {
31+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
32+
} // namespace edm4hep
33+
#endif
2734
#include "edm4hep/MCParticleCollection.h"
2835
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
2936

@@ -164,9 +171,9 @@ class TPCDigiAlg: public GaudiAlgorithm{
164171

165172
/** Output collection name.
166173
*/
167-
DataHandle<edm4hep::TrackerHitCollection> _TPCTrackerHitsColHdl{"TPCTrackerHits", Gaudi::DataHandle::Writer, this};
174+
DataHandle<edm4hep::TrackerHit3DCollection> _TPCTrackerHitsColHdl{"TPCTrackerHits", Gaudi::DataHandle::Writer, this};
168175
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _TPCAssColHdl{"TPCTrackerHitAss", Gaudi::DataHandle::Writer, this};
169-
edm4hep::TrackerHitCollection* _trkhitVec;
176+
edm4hep::TrackerHit3DCollection* _trkhitVec;
170177
edm4hep::MCRecoTrackerAssociationCollection* _relCol;
171178

172179
bool _use_raw_hits_to_store_simhit_pointer;

Reconstruction/DCHDedx/src/RecDCHDedxAlg.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
#include "edm4hep/EventHeaderCollection.h"
33
#include "edm4hep/MCParticleCollection.h"
44
#include "edm4hep/SimTrackerHitCollection.h"
5+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
6+
#include "edm4hep/TrackerHit3DCollection.h"
7+
#else
58
#include "edm4hep/TrackerHitCollection.h"
9+
namespace edm4hep {
10+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
11+
} // namespace edm4hep
12+
#endif
613
#include "edm4hep/TrackCollection.h"
714
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
815
#include "edm4hep/MCRecoParticleAssociationCollection.h"

Reconstruction/PFA/Arbor/src/ArborToolLCIO.hh

+7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
#include "edm4hep/ReconstructedParticleCollection.h"
99
#include "edm4hep/EventHeaderCollection.h"
1010
#include "edm4hep/SimTrackerHitCollection.h"
11+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
12+
#include "edm4hep/TrackerHit3DCollection.h"
13+
#else
1114
#include "edm4hep/TrackerHitCollection.h"
15+
namespace edm4hep {
16+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
17+
} // namespace edm4hep
18+
#endif
1219
#include "edm4hep/CalorimeterHitCollection.h"
1320
#include "edm4hep/VertexCollection.h"
1421
#include "edm4hep/TrackCollection.h"

Reconstruction/PFA/Pandora/GaudiPandora/include/PandoraPFAlg.h

+7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
#include "edm4hep/ReconstructedParticleCollection.h"
88
#include "edm4hep/EventHeaderCollection.h"
99
#include "edm4hep/SimTrackerHitCollection.h"
10+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
11+
#include "edm4hep/TrackerHit3DCollection.h"
12+
#else
1013
#include "edm4hep/TrackerHitCollection.h"
14+
namespace edm4hep {
15+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
16+
} // namespace edm4hep
17+
#endif
1118
#include "edm4hep/CalorimeterHitCollection.h"
1219
#include "edm4hep/VertexCollection.h"
1320
#include "edm4hep/TrackCollection.h"

Reconstruction/PFA/Pandora/GaudiPandora/src/TrackCreator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ void TrackCreator::TrackReachesECAL(const edm4hep::Track *const pTrack, PandoraA
786786
for (unsigned int i = 0; i < nTrackHits; ++i)
787787
{
788788

789-
const edm4hep::TrackerHit Hit ( pTrack->getTrackerHits(i) );
789+
const edm4hep::TrackerHit3D Hit ( pTrack->getTrackerHits(i) );
790790
const edm4hep::Vector3d pos = Hit.getPosition();
791791

792792
float x = float(pos[0]);

Reconstruction/PFA/Pandora/MatrixPandora/include/PandoraMatrixAlg.h

+7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@
88
#include "edm4hep/ReconstructedParticleCollection.h"
99
#include "edm4hep/EventHeaderCollection.h"
1010
#include "edm4hep/SimTrackerHitCollection.h"
11+
#if __has_include("edm4hep/TrackerHit3DCollection.h")
12+
#include "edm4hep/TrackerHit3DCollection.h"
13+
#else
1114
#include "edm4hep/TrackerHitCollection.h"
15+
namespace edm4hep {
16+
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
17+
} // namespace edm4hep
18+
#endif
1219
#include "edm4hep/CalorimeterHitCollection.h"
1320
#include "edm4hep/VertexCollection.h"
1421
#include "edm4hep/TrackCollection.h"

Reconstruction/PFA/Pandora/MatrixPandora/src/TrackCreator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ void TrackCreator::TrackReachesECAL(edm4hep::Track *const pTrack, PandoraApi::Tr
647647
for (unsigned int i = 0; i < nTrackHits; ++i)
648648
{
649649

650-
const edm4hep::TrackerHit Hit ( pTrack->getTrackerHits(i) );
650+
const edm4hep::TrackerHit3D Hit ( pTrack->getTrackerHits(i) );
651651
const edm4hep::Vector3d pos = Hit.getPosition();
652652

653653
float x = float(pos[0]);

Reconstruction/RecAssociationMaker/src/TrackParticleRelationAlg.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ StatusCode TrackParticleRelationAlg::execute() {
5555
}
5656

5757
// Prepare map from hit to MCParticle
58-
std::map<edm4hep::TrackerHit, edm4hep::MCParticle> mapHitParticle;
58+
std::map<edm4hep::TrackerHit3D, edm4hep::MCParticle> mapHitParticle;
5959
debug() << "reading Association" << endmsg;
6060
for (auto hdl : m_inAssociationColHdls) {
6161
const edm4hep::MCRecoTrackerAssociationCollection* assCol = nullptr;
@@ -92,7 +92,7 @@ StatusCode TrackParticleRelationAlg::execute() {
9292
}
9393

9494
if(trkCol) {
95-
std::map<edm4hep::MCParticle, std::vector<edm4hep::TrackerHit> > mapParticleHits;
95+
std::map<edm4hep::MCParticle, std::vector<edm4hep::TrackerHit3D> > mapParticleHits;
9696

9797
for (auto track: *trkCol) {
9898
std::map<edm4hep::MCParticle, int> mapParticleNHits;
@@ -128,7 +128,7 @@ StatusCode TrackParticleRelationAlg::execute() {
128128
}
129129

130130
if (msgLevel(MSG::DEBUG)) {
131-
for (std::map<edm4hep::MCParticle, std::vector<edm4hep::TrackerHit> >::iterator it=mapParticleHits.begin(); it!=mapParticleHits.end(); it++) {
131+
for (std::map<edm4hep::MCParticle, std::vector<edm4hep::TrackerHit3D> >::iterator it=mapParticleHits.begin(); it!=mapParticleHits.end(); it++) {
132132
auto particle = it->first;
133133
auto hits = it->second;
134134
debug() << "=== MCPaticle ===" << particle << endmsg;

Reconstruction/RecGenfitAlg/src/GenfitHit.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
#include "DD4hep/DetElement.h"
88
#include "DD4hep/Segmentations.h"
99
#include "DD4hep/DD4hepUnits.h"
10+
#if __has_include("edm4hep/TrackerHit3D.h")
11+
#include "edm4hep/TrackerHit3D.h"
12+
#else
1013
#include "edm4hep/TrackerHit.h"
14+
namespace edm4hep {
15+
using TrackerHit3D = edm4hep::TrackerHit;
16+
} // namespace edm4hep
17+
#endif
1118
#include "edm4hep/SimTrackerHit.h"
1219
#include "TRandom.h"
1320

1421
#include <iostream>
1522

16-
GenfitHit::GenfitHit(const edm4hep::TrackerHit* trackerHit,
23+
GenfitHit::GenfitHit(const edm4hep::TrackerHit3D* trackerHit,
1724
const edm4hep::SimTrackerHit* simTrackerHit,
1825
const dd4hep::DDSegmentation::BitFieldCoder* decoder,
1926
const dd4hep::DDSegmentation::GridDriftChamber* gridDriftChamber,

Reconstruction/RecGenfitAlg/src/GenfitHit.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace dd4hep {
2525

2626
class GenfitHit{
2727
public:
28-
GenfitHit(const edm4hep::TrackerHit* trackerHit,
28+
GenfitHit(const edm4hep::TrackerHit3D* trackerHit,
2929
const edm4hep::SimTrackerHit* simTrackerHit,
3030
const dd4hep::DDSegmentation::BitFieldCoder* decoder,
3131
const dd4hep::DDSegmentation::GridDriftChamber* gridDriftChamber,
@@ -38,7 +38,7 @@ class GenfitHit{
3838
double getDriftDistanceErr()const{return m_driftDistanceErr;}
3939
double getDriftDistanceTruth()const{return m_driftDistanceTruth;}
4040
const edm4hep::SimTrackerHit* getSimTrackerHit()const{return m_simTrackerHit;}
41-
const edm4hep::TrackerHit* getTrackerHit()const{return m_trackerHit;}
41+
const edm4hep::TrackerHit3D* getTrackerHit()const{return m_trackerHit;}
4242
TVector3 getEnd0()const;
4343
TVector3 getEnd1()const;
4444
TVector3 getTruthPos()const;
@@ -54,7 +54,7 @@ class GenfitHit{
5454
private:
5555
const dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
5656
const dd4hep::DDSegmentation::GridDriftChamber* m_gridDriftChamber;
57-
const edm4hep::TrackerHit* m_trackerHit;
57+
const edm4hep::TrackerHit3D* m_trackerHit;
5858
const edm4hep::SimTrackerHit* m_simTrackerHit;
5959
double m_driftDistance;
6060
double m_driftDistanceErr;

0 commit comments

Comments
 (0)