Skip to content

Commit 330417b

Browse files
committed
add new cut files
1 parent a30fe9d commit 330417b

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// $Id$
2+
//
3+
// File: DCustomAction_p3pi_Pi0Cuts_FCAL2.cc
4+
// Created: Thu Jan 22 11:19:47 EST 2015
5+
// Creator: jrsteven (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64)
6+
//
7+
8+
#include "DCustomAction_p3pi_Pi0Cuts_FCAL2.h"
9+
10+
void DCustomAction_p3pi_Pi0Cuts_FCAL2::Initialize(const std::shared_ptr<const JEvent>& locEvent)
11+
{
12+
13+
}
14+
15+
bool DCustomAction_p3pi_Pi0Cuts_FCAL2::Perform_Action(const std::shared_ptr<const JEvent>& locEvent, const DParticleCombo* locParticleCombo)
16+
{
17+
const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(2);
18+
if(Get_Reaction()->Get_ReactionStep(2)->Get_InitialPID() != Pi0)
19+
return false;
20+
21+
// get final state particles
22+
auto locParticles = Get_UseKinFitResultsFlag() ? locParticleComboStep->Get_FinalParticles() : locParticleComboStep->Get_FinalParticles_Measured();
23+
24+
int nFECAL = 0; // FCAL2 = FCAL + ECAL
25+
26+
// loop final state particles
27+
for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i) {
28+
if(locParticles[loc_i] == nullptr) continue;
29+
30+
// get shower object
31+
const DNeutralShower* locNeutralShower = static_cast<const DNeutralShower*>(locParticleComboStep->Get_FinalParticle_SourceObject(loc_i));
32+
if(locNeutralShower == NULL)
33+
continue;
34+
35+
// count # of FCAL photons and set separate thresholds on FCAL and BCAL energies
36+
if(locNeutralShower->dDetectorSystem == SYS_FCAL) {
37+
nFECAL++;
38+
}
39+
if(locNeutralShower->dDetectorSystem == SYS_ECAL) {
40+
nFECAL++;
41+
}
42+
}
43+
44+
// require 1 or 2 photons in FCAL2 (specify parameter in DReaction setup)
45+
if(nFECAL != dMinFECAL)
46+
return false;
47+
48+
// passed all cuts
49+
return true;
50+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// $Id$
2+
//
3+
// File: DCustomAction_p3pi_Pi0Cuts_FCAL2.h
4+
// Created: Thu Jan 22 11:19:46 EST 2015
5+
// Creator: jrsteven (on Linux ifarm1401 2.6.32-431.el6.x86_64 x86_64)
6+
//
7+
8+
#ifndef _DCustomAction_p3pi_Pi0Cuts_FCAL2_
9+
#define _DCustomAction_p3pi_Pi0Cuts_FCAL2_
10+
11+
#include <string>
12+
#include <iostream>
13+
14+
#include <JANA/JEvent.h>
15+
#include "JANA/JApplication.h"
16+
17+
#include "ANALYSIS/DAnalysisAction.h"
18+
#include "ANALYSIS/DReaction.h"
19+
#include "ANALYSIS/DParticleCombo.h"
20+
#include "ANALYSIS/DAnalysisUtilities.h"
21+
22+
using namespace std;
23+
24+
class DCustomAction_p3pi_Pi0Cuts_FCAL2 : public DAnalysisAction
25+
{
26+
public:
27+
28+
DCustomAction_p3pi_Pi0Cuts_FCAL2(const DReaction* locReaction, bool locUseKinFitResultsFlag, double locMinFECAL,
29+
string locActionUniqueString = "") :
30+
DAnalysisAction(locReaction, "Custom_p3pi_Pi0Cuts", locUseKinFitResultsFlag, locActionUniqueString),
31+
dMinFECAL(locMinFECAL) {}
32+
33+
void Initialize(const std::shared_ptr<const JEvent>& locEvent);
34+
void Run_Update(const std::shared_ptr<const JEvent>& locEvent) {}
35+
36+
private:
37+
38+
bool Perform_Action(const std::shared_ptr<const JEvent>& locEvent, const DParticleCombo* locParticleCombo);
39+
40+
//Store any histograms as member variables here
41+
double dMinFECAL; // FCAL2 = FCAL+ECAL
42+
43+
};
44+
45+
#endif // _DCustomAction_p3pi_Pi0Cuts_FCAL2_
46+

0 commit comments

Comments
 (0)