1 #include "p0dExampleSelection.hxx" 2 #include "baseSelection.hxx" 3 #include "DataClasses.hxx" 4 #include "CutUtils.hxx" 5 #include "SubDetId.hxx" 6 #include "EventBoxUtils.hxx" 7 #include "P0DAnalysisUtils.hxx" 11 bool _isUsingReconDirP0D=
false;
12 bool _isUsingReconDirP0DNew=
false;
19 _debug = ND::params().
GetParameterI(
"baseP0DAnalysis.Example.DebugSelection");
22 _isUsingReconDirP0D = ND::params().
GetParameterI(
"highlandIO.FlatTree.UseReconDirP0D");
25 _isUsingReconDirP0DNew = ND::params().
GetParameterI(
"highlandIO.P0DDataClasses.UseReconDirP0DNew");
32 SetDetectorFV(SubDetId::kP0D);
45 AddStep(StepBase::kCut,
"0 tracks",
new NoTracksCut());
49 SetBranchAlias(0,
"trunk");
62 if(!event.EventBoxes[EventBoxId::kEventBoxP0D])
63 event.EventBoxes[EventBoxId::kEventBoxP0D] =
new EventBoxP0D2();
65 boxP0DUtils::FillVerticesFinal(event);
66 boxP0DUtils::FillP0DParticles(event);
79 if (_isUsingReconDirP0DNew){
81 EventBoxB* EventBox =
event.EventBoxes[EventBoxId::kEventBoxP0D];
86 if (p0dBox->nShowers>0) p0dBox->Shower1 =
static_cast<AnaP0DParticle*
>(EventBox->RecObjectsInGroup[EventBoxP0D2::kP0DShowers][0]);
87 if (p0dBox->nShowers>1) p0dBox->Shower2 =
static_cast<AnaP0DParticle*
>(EventBox->RecObjectsInGroup[EventBoxP0D2::kP0DShowers][1]);
89 else if (_isUsingReconDirP0D){
91 for(std::vector<AnaP0DReconVertex*>::iterator it =localEvent->P0DReconVertices.begin(); it!= localEvent->P0DReconVertices.end(); ++it ){
93 std::cout <<
"P0DReconVertices:AlgorithmName : " << (*it)->AlgorithmName <<
" Cycle: " << (*it)->Cycle
94 <<
" Bunch: " << (*it)->
Bunch << std::endl;
97 for(std::vector<AnaP0DReconParticle*>::iterator it2 =(*it)->ParticlesP.begin(); it2!= (*it)->ParticlesP.end(); ++it2, i++ ){
99 std::cout <<
" - " << i <<
": P0DReconParticles:AlgorithmName : " << (*it2)->AlgorithmName <<
" Cycle: " << (*it2)->Cycle
100 <<
" Bunch: " << (*it2)->Bunch <<
" p = " << (*it2)->Momentum <<
" E = " << (*it2)->EDeposit <<
" l = " << (*it2)->Length
101 <<
" nShowers = " << (*it2)->Showers.size() <<
" nTracks = " << (*it2)->Tracks.size() << std::endl;
103 if ((*it2)->AlgorithmName.find(
"Shower")!=std::string::npos){
108 std::cout <<
"NShowers = " << p0dBox->nShowers << std::endl;
126 return (p0dBox->nShowers==2);
139 return (p0dBox->nTracks==0);
153 return (static_cast<AnaEvent*>(&event)->nDelayedClusters==0);
165 if (_isUsingReconDirP0DNew){
AnaTrueVertexB * TrueVertex
Pointer to the AnaTrueVertexB of the interaction that created this AnaTrueParticleB.
bool Apply(AnaEventC &event, ToyBoxB &box) const
int GetParameterI(std::string)
Get parameter. Value is returned as integer.
void DefineSteps()
Define all steps in the selection.
bool Apply(AnaEventC &event, ToyBoxB &box) const
AnaTrueVertexB * TrueVertex
For storing the true vertex, for analyses with no reconstructed primary vertex.
virtual const ToyBoxP0D & box(Int_t isel=-1) const
Returns the ToyBoxP0D.
Int_t nRecObjectsInGroup[NMAXRECOBJECTGROUPS]
----—— RecObjects and TrueRecObjects used in the selection and systematics ------------—— ...
bool Apply(AnaEventC &event, ToyBoxB &box) const
Int_t Bunch
The index of this bunch (0-7).
bool Apply(AnaEventC &event, ToyBoxB &box) const
void InitializeEvent(AnaEventC &event)
Fill the EventBox with the objects needed by this selection.
AnaTrueParticleB * GetTrueParticle() const
Return a casted version of the AnaTrueObject associated.
A cut on event quality. Requires good beam and ND280 data quality flags.
bool Apply(AnaEventC &event, ToyBoxB &box) const
void DefineDetectorFV()
Define the detector Fiducial Volume in which this selection is applied.