Skip to content
Snippets Groups Projects
Commit ca24e1df authored by myliu@ihep.ac.cn's avatar myliu@ihep.ac.cn
Browse files

check doca

parent c2dd2d13
No related branches found
No related tags found
No related merge requests found
......@@ -28,15 +28,15 @@ DCHDigiAlg::DCHDigiAlg(const std::string& name, ISvcLocator* svcLoc)
: GaudiAlgorithm(name, svcLoc),
_nEvt(0)
{
// Input collections
declareProperty("SimDCHitCollection", r_SimDCHCol, "Handle of the Input SimHit collection");
// Output collections
declareProperty("DigiDCHitCollection", w_DigiDCHCol, "Handle of Digi DCHit collection");
declareProperty("AssociationCollection", w_AssociationCol, "Handle of Association collection");
}
StatusCode DCHDigiAlg::initialize()
......@@ -54,7 +54,6 @@ StatusCode DCHDigiAlg::initialize()
}
if(m_WriteAna){
NTuplePtr nt( ntupleSvc(), "MyTuples/DCH_digi_evt" );
if ( nt ) m_tuple = nt;
else {
......@@ -105,8 +104,8 @@ StatusCode DCHDigiAlg::execute()
unsigned long long id = SimHit.getCellID();
float sim_hit_mom = sqrt( SimHit.getMomentum()[0]*SimHit.getMomentum()[0] + SimHit.getMomentum()[1]*SimHit.getMomentum()[1] + SimHit.getMomentum()[2]*SimHit.getMomentum()[2] );//GeV
if(sim_hit_mom < m_mom_threshold) continue;
if(SimHit.getEDep() <= 0) continue;
if(SimHit.getEDep() <= 0) continue;
if ( id_hits_map.find(id) != id_hits_map.end()) id_hits_map[id].push_back(SimHit);
else
{
......
......@@ -69,9 +69,9 @@ protected:
dd4hep::rec::CellIDPositionConverter* m_cellIDConverter;
dd4hep::DDSegmentation::GridDriftChamber* m_segmentation;
dd4hep::DDSegmentation::BitFieldCoder* m_decoder;
Gaudi::Property<std::string> m_readout_name{ this, "readout", "DriftChamberHitsCollection"};//readout for getting segmentation
Gaudi::Property<float> m_res_x { this, "res_x", 0.11};//mm
Gaudi::Property<float> m_res_y { this, "res_y", 0.11};//mm
Gaudi::Property<float> m_res_z { this, "res_z", 1 };//mm
......@@ -86,6 +86,6 @@ protected:
// Output collections
DataHandle<edm4hep::TrackerHitCollection> w_DigiDCHCol{"DigiDCHitCollection", Gaudi::DataHandle::Writer, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> w_AssociationCol{"DCHitAssociationCollection", Gaudi::DataHandle::Writer, this};
};
};
#endif
......@@ -3,8 +3,6 @@
if (GenFit_FOUND)
gaudi_add_module(RecGenfitAlg
SOURCES src/RecGenfitAlgDC.cpp
src/DCHDigiSMAlg.cpp
src/DumpTrackAlg.cpp
src/GenfitTrack.cpp
src/GenfitField.cpp
src/GenfitFitter.cpp
......
......@@ -382,20 +382,21 @@ void RecGenfitAlgDC::debugEvent()
mcParticleCol=m_mcParticleCol.get();
simDCHitCol=m_simDCHitCol.get();
m_nSimDCHit=simDCHitCol->size();
int iMcParticle=0;
int iHit=0;
for(auto simDCHit: *simDCHitCol){
edm4hep::Vector3d pos=simDCHit.position();
TVectorD p(3);
p[0]=pos.x;//no unit conversion here
p[1]=pos.y;
p[2]=pos.z;
m_mdcHitMcX[iHit]=pos.x;
m_mdcHitMcY[iHit]=pos.y;
m_mdcHitMcZ[iHit]=pos.z;
iHit++;
}
m_mcIndex=iHit;
int iMcParticle=0;
for(auto mcParticle : *mcParticleCol){
for(auto simDCHit: *simDCHitCol){
edm4hep::Vector3d pos=simDCHit.position();
TVectorD p(3);
p[0]=pos.x;//no unit conversion here
p[1]=pos.y;
p[2]=pos.z;
m_mdcHitMcX[iHit]=pos.x;
m_mdcHitMcY[iHit]=pos.y;
m_mdcHitMcZ[iHit]=pos.z;
iHit++;
}
edm4hep::Vector3f mcPocaMom = mcParticle.getMomentum();//GeV
float px=mcPocaMom.x;
float py=mcPocaMom.y;
......@@ -404,6 +405,5 @@ void RecGenfitAlgDC::debugEvent()
m_pocaMomMcP[iMcParticle]=sqrt(px*px+py*py+pz*pz);
iMcParticle++;
}
m_mcIndex=iHit;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment