17 bool locFirstIsNaN = (!(locNeutralShower1->
dEnergy > -1.0) && !(locNeutralShower1->
dEnergy < 1.0));
18 bool locSecondIsNaN = (!(locNeutralShower2->
dEnergy > -1.0) && !(locNeutralShower2->
dEnergy < 1.0));
23 double locE1 = locNeutralShower1->
dEnergy - double(
int(locNeutralShower1->
dEnergy*100.0))/100.0;
24 double locE2 = locNeutralShower2->
dEnergy - double(
int(locNeutralShower2->
dEnergy*100.0))/100.0;
25 return (locE1 < locE2);
58 double locTargetCenterZ;
71 locEventLoop->GetSingle(locDetectorMatches);
73 vector<const DBCALShower*> locBCALShowers;
74 locEventLoop->Get(locBCALShowers);
76 vector<const DFCALShower*> locFCALShowers;
77 locEventLoop->Get(locFCALShowers);
79 vector< const DEventRFBunch* > eventRFBunches;
80 locEventLoop->Get(eventRFBunches);
82 assert( eventRFBunches.size() == 1 );
83 double rfTime = eventRFBunches[0]->dTime;
87 JObject::oid_t locShowerID = 0;
88 for(
size_t loc_i = 0; loc_i < locBCALShowers.size(); ++loc_i)
95 locNeutralShower->
dBCALFCALShower =
static_cast<const JObject*
>(locBCALShowers[loc_i]);
97 locNeutralShower->
dShowerID = locShowerID;
104 locNeutralShower->
dEnergy = locBCALShowers[loc_i]->E;
105 locNeutralShower->
dSpacetimeVertex.SetXYZT(locBCALShowers[loc_i]->
x, locBCALShowers[loc_i]->
y, locBCALShowers[loc_i]->z, locBCALShowers[loc_i]->t);
107 locCovMatrix->ResizeTo(5, 5);
108 *locCovMatrix = locBCALShowers[loc_i]->ExyztCovariance;
111 locNeutralShower->AddAssociatedObject(locBCALShowers[loc_i]);
113 _data.push_back(locNeutralShower);
118 for(
size_t loc_i = 0; loc_i < locFCALShowers.size(); ++loc_i)
125 locNeutralShower->
dBCALFCALShower =
static_cast<const JObject*
>(locFCALShowers[loc_i]);
127 locNeutralShower->
dShowerID = locShowerID;
130 locNeutralShower->
dEnergy = locFCALShowers[loc_i]->getEnergy();
131 locNeutralShower->
dSpacetimeVertex.SetVect(locFCALShowers[loc_i]->getPosition());
137 locCovMatrix->ResizeTo(5, 5);
138 *locCovMatrix = locFCALShowers[loc_i]->ExyztCovariance;
141 locNeutralShower->AddAssociatedObject(locFCALShowers[loc_i]);
143 _data.push_back(locNeutralShower);
170 double flightTime = fcalShower->
getTime() - rfTime;
172 vector< double > mvaInputs( 8 );
174 mvaInputs[1] = fcalShower->
getE9E25();
175 mvaInputs[2] = fcalShower->
getE1E9();
176 mvaInputs[3] = fcalShower->
getSumU();
177 mvaInputs[4] = fcalShower->
getSumV();
178 mvaInputs[5] = ( mvaInputs[3] - mvaInputs[4] ) / ( mvaInputs[3] + mvaInputs[4] );
179 mvaInputs[6] = flightDistance / flightTime;
jerror_t evnt(jana::JEventLoop *locEventLoop, uint64_t eventnumber)
Called every event.
const JObject * dBCALFCALShower
jerror_t brun(jana::JEventLoop *locEventLoop, int32_t runnumber)
Called everytime a new run number is detected.
DNeutralShower_FCALQualityMLP * dFCALClassifier
double GetMvaValue(const std::vector< double > &inputValues) const
DetectorSystem_t dDetectorSystem
DLorentzVector dSpacetimeVertex
double getFCALQuality(const DFCALShower *fcalShower, double rfTime) const
jerror_t init(void)
Called once at program start.
DGeometry * GetDGeometry(unsigned int run_number)
shared_ptr< TMatrixFSym > dCovarianceMatrix
shared_ptr< DResourcePool< TMatrixFSym > > dResourcePool_TMatrixFSym
jerror_t fini(void)
Called after last event of last event source has been processed.
const char * inputVars[8]
double getTimeTrack() const
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
bool DNeutralShower_SortByEnergy(const DNeutralShower *locNeutralShower1, const DNeutralShower *locNeutralShower2)
DVector3 getPosition() const
bool GetTargetZ(double &z_target) const
z-location of center of target
bool Get_IsMatchedToTrack(const DBCALShower *locBCALShower) const