-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from brownd1978/crvhelp
Move CRVAnalysis to CrvInfoHelper
- Loading branch information
Showing
26 changed files
with
719 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
#include "TrkAna/fcl/TrkAnaReco.fcl" | ||
|
||
physics.analyzers.TrkAnaNeg.FillCRVHits : true | ||
physics.analyzers.TrkAnaNeg.FillCRVPulses : false | ||
|
||
physics.analyzers.TrkAnaPos.FillCRVHits : true | ||
physics.analyzers.TrkAnaPos.FillCRVPulses : false | ||
physics.analyzers.TrkAnaPos.FillCRVPulses : false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef CrvHitInfoMC_hh | ||
#define CrvHitInfoMC_hh | ||
|
||
#include "CLHEP/Vector/ThreeVector.h" | ||
#include <vector> | ||
#include "Rtypes.h" | ||
#include "Offline/DataProducts/inc/GenVector.hh" | ||
|
||
namespace mu2e | ||
{ | ||
struct CrvHitInfoMC //information about the MC track which most likely caused the CRV coincidence triplets | ||
{ | ||
Bool_t valid = false; //was an MC particle found that matches the coincidence triplets? | ||
Int_t pdgId = -1; //PDG ID of this MC particle | ||
Int_t primaryPdgId = -1; //PDG ID of the primary particle of this MC particle (helps to determine whether it was a cosmic ray, etc.) | ||
Float_t primaryE = -1; //energy of the primary particle of this MC particle | ||
XYZVectorF primary; //starting point of the primary particle of this MC particle | ||
Int_t parentPdgId = -1; //PDG ID of the parent particle of this MC particle (helps to determine whether it was a cosmic ray, etc.) | ||
Float_t parentE = -1; //energy of the parent particle of this MC particle | ||
XYZVectorF parent; //starting point of the parent particle of this MC particle | ||
Int_t gparentPdgId = -1; //PDG ID of the gparent particle of this MC particle (helps to determine whether it was a cosmic ray, etc.) | ||
Float_t gparentE = -1; //energy of the gparent particle of this MC particle | ||
XYZVectorF gparent; //starting point of the gparent particle of this MC particle | ||
XYZVectorF pos; //position of the MC particle when it "created" the first StepPointMC | ||
Float_t time = -1; //time of the MC particle when it "created" the first StepPointMC | ||
Float_t depositedEnergy = -1; //total energy deposited for this cluster (not just for this track) | ||
CrvHitInfoMC(){} | ||
CrvHitInfoMC(bool valid, int pdgId, | ||
int primaryPdgId, float primaryE, CLHEP::Hep3Vector primaryPos, | ||
int parentPdgId, float parentE, CLHEP::Hep3Vector parentPos, | ||
int gparentPdgId, float gparentE, CLHEP::Hep3Vector gparentPos, | ||
CLHEP::Hep3Vector pos, float time, float depositedEnergy) : | ||
valid(valid), | ||
pdgId(pdgId), | ||
primaryPdgId(primaryPdgId), | ||
primaryE(primaryE), | ||
primary(primaryPos), | ||
parentPdgId(parentPdgId), | ||
parentE(parentE), | ||
parent(parentPos), | ||
gparentPdgId(gparentPdgId), | ||
gparentE(gparentE), | ||
gparent(gparentPos), | ||
pos(pos), | ||
time(time), | ||
depositedEnergy(depositedEnergy) | ||
{} | ||
}; | ||
|
||
typedef std::vector<CrvHitInfoMC> CrvHitInfoMCCollection; //this is the MC vector which will be stored in the main TTree | ||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#ifndef CrvHitInfoReco_hh | ||
#define CrvHitInfoReco_hh | ||
|
||
#include "Offline/DataProducts/inc/GenVector.hh" | ||
#include "CLHEP/Vector/ThreeVector.h" | ||
#include <vector> | ||
#include "Rtypes.h" | ||
|
||
namespace mu2e | ||
{ | ||
|
||
struct CrvHitInfoReco //information about a cluster of CRV coincidence triplets | ||
{ | ||
Int_t sectorType =-1; //CRV sector type | ||
XYZVectorF pos; //average position of counters | ||
Float_t timeStart = -1; //first hit time | ||
Float_t timeEnd = -1; //last hit time | ||
Float_t time = -1; // average hit time | ||
Int_t PEs = -1; //total number of PEs for this cluster | ||
Int_t nHits = -1; //number of coincidence hits in this cluster | ||
Int_t nLayers = -1; //number of coincidence layers in this cluster | ||
Float_t angle = -999; //coincidence direction | ||
|
||
CrvHitInfoReco(){} | ||
CrvHitInfoReco(int sectorType, CLHEP::Hep3Vector hpos, float timeWindowStart, float timeWindowEnd, float timeAvg, int PEs, int nCoincidenceHits, int nCoincidenceLayers, float coincidenceAngle) : | ||
sectorType(sectorType), | ||
pos(hpos), | ||
timeStart(timeWindowStart), | ||
timeEnd(timeWindowEnd), | ||
time(timeAvg), | ||
PEs(PEs), | ||
nHits(nCoincidenceHits), | ||
nLayers(nCoincidenceLayers), | ||
angle(coincidenceAngle) | ||
{} | ||
}; | ||
|
||
typedef std::vector<CrvHitInfoReco> CrvHitInfoRecoCollection; //this is the reco vector which will be stored in the main TTree | ||
|
||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Replacement for CRVAnalysis | ||
// | ||
#include "TrkAna/inc/CrvHitInfoReco.hh" | ||
#include "TrkAna/inc/CrvHitInfoMC.hh" | ||
#include "TrkAna/inc/CrvWaveformInfo.hh" | ||
#include "TrkAna/inc/CrvSummaryReco.hh" | ||
#include "TrkAna/inc/CrvSummaryMC.hh" | ||
#include "TrkAna/inc/CrvPlaneInfoMC.hh" | ||
#include "TrkAna/inc/CrvPulseInfoReco.hh" | ||
#include "Offline/RecoDataProducts/inc/CrvCoincidenceCluster.hh" | ||
#include "Offline/RecoDataProducts/inc/CrvRecoPulse.hh" | ||
#include "Offline/RecoDataProducts/inc/CrvDigi.hh" | ||
#include "Offline/MCDataProducts/inc/CrvDigiMC.hh" | ||
#include "Offline/MCDataProducts/inc/CrvStep.hh" | ||
#include "Offline/MCDataProducts/inc/SimParticle.hh" | ||
#include "Offline/MCDataProducts/inc/CrvCoincidenceClusterMC.hh" | ||
#include "Offline/MCDataProducts/inc/MCTrajectory.hh" | ||
#include "art/Framework/Principal/Handle.h" | ||
|
||
namespace mu2e | ||
{ | ||
class CrvInfoHelper | ||
{ | ||
public: | ||
|
||
CrvInfoHelper() {} | ||
|
||
void FillCrvHitInfoCollections( | ||
art::Handle<CrvCoincidenceClusterCollection> const& crvCoincidences, | ||
art::Handle<CrvCoincidenceClusterMCCollection> const& crvCoincidencesMC, | ||
art::Handle<CrvRecoPulseCollection> const& crvRecoPulses, | ||
art::Handle<CrvStepCollection> const& crvSteps, | ||
art::Handle<MCTrajectoryCollection> const& mcTrajectories, | ||
CrvHitInfoRecoCollection &recoInfo, CrvHitInfoMCCollection &MCInfo, | ||
CrvSummaryReco &recoSummary, CrvSummaryMC &MCSummary, | ||
CrvPlaneInfoMCCollection &MCInfoPlane, double crvPlaneY); | ||
|
||
void FillCrvPulseInfoCollections( | ||
art::Handle<CrvRecoPulseCollection> const& crvRecoPulses, | ||
art::Handle<CrvDigiMCCollection> const& crvDigiMCs, | ||
art::Handle<CrvDigiCollection> const& crvDigis, | ||
CrvPulseInfoRecoCollection &recoInfo, CrvHitInfoMCCollection &MCInfo, CrvWaveformInfoCollection &waveformInfo); | ||
|
||
private: | ||
static const art::Ptr<SimParticle> &FindPrimaryParticle(const art::Ptr<SimParticle> &simParticle) | ||
{ | ||
return simParticle->hasParent() ? FindPrimaryParticle(simParticle->parent()) : simParticle; | ||
} | ||
static const SimParticle &FindPrimaryParticle(const SimParticle &simParticle) | ||
{ | ||
return simParticle.hasParent() ? *FindPrimaryParticle(simParticle.parent()) : simParticle; | ||
} | ||
static const art::Ptr<SimParticle> &FindParentParticle(const art::Ptr<SimParticle> &simParticle) | ||
{ | ||
return simParticle->hasParent() ? simParticle->parent() : simParticle; | ||
} | ||
static const art::Ptr<SimParticle> &FindGParentParticle(const art::Ptr<SimParticle> &simParticle) | ||
{ | ||
const art::Ptr<SimParticle> &parentParticle = simParticle->hasParent() ? simParticle->parent() : simParticle; | ||
return parentParticle->hasParent() ? parentParticle->parent() : parentParticle; | ||
} | ||
|
||
static const int _trajectorySimParticleId = 300001; //only temporarily here for some tests | ||
}; | ||
|
||
} |
Oops, something went wrong.