1 #ifndef FEATUREVERTEXFINDERANA_H 2 #define FEATUREVERTEXFINDERANA_H 68 #include "TGeoManager.h" 204 fRun = tfs->
make<TH1F>(
"fRun",
"Run Number", 1000, 0, 1000);
205 fEvt = tfs->
make<TH1F>(
"fEvt",
"Event Number", 1000, 0, 1000);
206 fTruthVtxXPos = tfs->
make<TH1F>(
"fTruthVtxXPos",
"Truth Vertex X Position", 400, 0, 200);
207 fTruthVtxYPos = tfs->
make<TH1F>(
"fTruthVtxYPos",
"Truth Vertex Y Position", 400, -100, 100);
208 fTruthVtxZPos = tfs->
make<TH1F>(
"fTruthVtxZPos",
"Truth Vertex Z Position", 2000, 0, 1000);
222 fTwoDNVtxPlane0 = tfs->
make<TH1F>(
"fTwoDNVtxPlane0",
"TwoD Number of Verticies Found in Plane 0", 400, 0, 200);
223 fTwoDNVtxPlane1 = tfs->
make<TH1F>(
"fTwoDNVtxPlane1",
"TwoD Number of Verticies Found in Plane 1", 400, 0, 200);
224 fTwoDNVtxPlane2 = tfs->
make<TH1F>(
"fTwoDNVtxPlane2",
"TwoD Number of Verticies Found in Plane 2", 400, 0, 200);
258 fRecoVtxN3d = tfs->
make<TH1F>(
"fRecoVtxN3d",
"Number of 3d-Reco Verticies", 400, 0, 200);
259 fRecoVtxXPos = tfs->
make<TH1F>(
"fRecoVtxXPos",
"Reco Vertex X Position", 400, -10, 200);
260 fRecoVtxYPos = tfs->
make<TH1F>(
"fRecoVtxYPos",
"Reco Vertex Y Position", 400, -100, 100);
261 fRecoVtxZPos = tfs->
make<TH1F>(
"fRecoVtxZPos",
"Reco Vertex Z Position", 2000, -10, 1000);
263 fRecoCheck3dVtxX = tfs->
make<TH1F>(
"fRecoCheck3dVtxX",
"Reco X Position - True X Postion", 800, -100, 100);
264 fRecoCheck3dVtxY = tfs->
make<TH1F>(
"fRecoCheck3dVtxY",
"Reco Y Position - True Y Postion", 800, -100, 100);
265 fRecoCheck3dVtxZ = tfs->
make<TH1F>(
"fRecoCheck3dVtxZ",
"Reco Z Position - True Z Postion", 800, -100, 100);
267 fRecoCheck3dVtxXvsX = tfs->
make <TH2D>(
"fRecoCheck3dVtxXvsX",
"(Reco X - True X)/True X vs True X", 400, -10, 200, 120, -20, 20);
268 fRecoCheck3dVtxYvsY = tfs->
make <TH2D>(
"fRecoCheck3dVtxYvsY",
"(Reco Y - True Y)/True Y vs True Y", 400, -100, 100, 120, -20, 20);
269 fRecoCheck3dVtxZvsZ = tfs->
make <TH2D>(
"fRecoCheck3dVtxZvsZ",
"(Reco Z - True Z)/True Z vs True Z", 1000, -10, 1000, 120, -20, 20);
332 std::vector<double> WirePitch_CurrentPlane(geom->
Views().size(), 0.);
338 for(
auto v : geom->
Views() ){
339 WirePitch_CurrentPlane[vn] = geom->
WirePitch(v);
349 float TimetoCm = TimeTick*DriftVelocity;
363 for (
unsigned int ii = 0; ii < mctruthListHandle->size(); ++ii)
372 float truth_vertex[5] = {0.};
374 uint32_t VtxWireNum[3] = {0};
375 double VtxTimeTick[3] = {0.};
377 double VtxWireNum_InCM[3] = {0.};
378 double VtxTimeTick_InCM[3] = {0.};
384 for(
unsigned int i = 0; i < mclist.
size(); ++i )
392 truth_vertex[0] =neut.
Vx();
393 truth_vertex[1] =neut.Vy();
394 truth_vertex[2] =neut.Vz();
416 mf::LogWarning(
"FeatureVertexFinderAna") <<
"Can't find nearest wire";
424 VtxWireNum_InCM[
pid.Plane] = VtxWireNum[
pid.Plane] * WirePitch_CurrentPlane[
pid.Plane];
425 VtxTimeTick_InCM[
pid.Plane] = VtxTimeTick[
pid.Plane] * TimetoCm;
452 double Vertex2d_TimeTick[10000] = {0.};
453 double Vertex2d_Wire[10000] = {0.};
455 double Vertex2d_TimeTick_InCM[10000] = {0.};
456 double Vertex2d_Wire_InCM[10000] = {0.};
459 int n2dVtxPlane0 = 0, n2dVtxPlane1 = 0, n2dVtxPlane2 = 0;
461 bool vertexWstrengthplane0 = false , vertexWstrengthplane1 =
false;
466 for(
size_t ii = 0; ii < vertex2dHandle->size(); ++ii){
474 if(vert2d.
size() > 0)
481 for(
size_t ww = 0; ww<vert2d.
size(); ++ww){
485 if (vert2d[ww]->WireID().planeID() !=
pid){
continue;}
487 Vertex2d_TimeTick[n2dVtx] = vert2d[ww]->DriftTime();
488 Vertex2d_Wire[n2dVtx] = vert2d[ww]->WireID().Wire;
491 Vertex2d_Wire_InCM[n2dVtx] = Vertex2d_Wire[n2dVtx] * WirePitch_CurrentPlane[
pid.Plane];
494 Vertex2d_TimeTick_InCM[n2dVtx] = Vertex2d_TimeTick[n2dVtx] * TimetoCm;
500 float RecoCheck_TimeTick = Vertex2d_TimeTick[n2dVtx] - VtxTimeTick[
pid.Plane];
501 float RecoCheck_WireNum = Vertex2d_Wire[n2dVtx] - VtxWireNum[
pid.Plane];
503 float RecoCheck_TimeInCm = Vertex2d_TimeTick_InCM[n2dVtx] - VtxTimeTick_InCM[
pid.Plane];
504 float RecoCheck_WireInCm = Vertex2d_Wire_InCM[n2dVtx] - VtxWireNum_InCM[
pid.Plane];
508 if( vert2d[ww]->Strength() > -1)
512 vertexWstrengthplane0 =
true;
534 vertexWstrengthplane1 =
true;
590 double xyz[3] = {0.};
592 for(
unsigned int ii = 0; ii < vertex3dListHandle->size(); ++ii)
599 if(Vertexlist.
size() > 0 && vertexWstrengthplane0 && vertexWstrengthplane1)
603 for(
unsigned int ww = 0; ww<Vertexlist.
size(); ww++)
605 Vertexlist[ww]->XYZ(xyz);
613 double DeltaX = xyz[0] - truth_vertex[0] ;
614 double DeltaY = xyz[1] - truth_vertex[1] ;
615 double DeltaZ = xyz[2] - truth_vertex[2] ;
617 double DeltaXoverTrueX = DeltaX / truth_vertex[0];
618 double DeltaYoverTrueY = DeltaY / truth_vertex[0];
619 double DeltaZoverTrueZ = DeltaZ / truth_vertex[0];
647 #endif // FEATUREVERTEXFINDERANA_H TH1F * fTwoDTimeInCmPlane2
TH2D * fRecoCheck3dVtxXvsX
TH1F * fTwoDTimeTickPlane2
std::string fEndPoint2dModuleLabel
TH1F * fTwoDTimeInCmPlane0
TH1F * fTwoDTimeInCmPlane1
TH1F * fTruthTimeInCmPlane0
Encapsulate the construction of a single cyostat.
TH1F * fTwoDWireNumberPlane1
TH1F * fTruthWireNumberPlane0
TH1F * fTruthTimeTickPlane2
Declaration of signal hit object.
std::string fVertexModuleLabel
TH1F * fTwoDWireNumberPlane2
std::set< geo::View_t > const & Views() const
Returns a list of possible views in the detector.
TH1F * fRecoCheck2dWireNumPlane1
TH1F * fTruthWireInCmPlane2
void analyze(const art::Event &evt)
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
TH1F * fTruthWireInCmPlane1
TH1F * fRecoCheck2dTimeInCmPlane2
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
TH1F * fTwoDStrengthPlane2
virtual ~FeatureVertexFinderAna()
TH1F * fTruthTimeInCmPlane1
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
TH1F * fRecoCheck2dTimeInCmPlane1
TH1F * fRecoCheck2dTimeTickPlane2
IteratorBox< plane_id_iterator,&GeometryCore::begin_plane_id,&GeometryCore::end_plane_id > IteratePlaneIDs() const
Enables ranged-for loops on all plane IDs of the detector.
std::string fGenieModuleLabel
TH1F * fRecoCheck2dTimeTickPlane0
std::string fLArG4ModuleLabel
TH2D * fRecoCheck3dVtxZvsZ
FeatureVertexFinderAna(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
TH1F * fRecoCheck2dWireInCmPlane2
void reconfigure(fhicl::ParameterSet const &p)
void push_back(Ptr< U > const &p)
TH1F * fTwoDStrengthPlane0
TH1F * fTwoDStrengthPlane1
TH1F * fTwoDTimeTickPlane0
virtual double Temperature() const =0
T get(std::string const &key) const
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
TH1F * fTwoDTimeTickPlane1
TH1F * fTruthTimeTickPlane0
TH1F * fRecoCheck2dWireNumPlane2
EDAnalyzer(Table< Config > const &config)
Declaration of cluster object.
TH1F * fTruthWireNumberPlane2
TH1F * fRecoCheck2dTimeInCmPlane0
TH1F * fRecoCheck2dWireNumPlane0
Encapsulate the geometry of a wire.
const simb::MCParticle & GetParticle(int i) const
TH1F * fTruthTimeTickPlane1
double Vx(const int i=0) const
T * make(ARGS...args) const
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
TH1F * fRecoCheck2dWireInCmPlane1
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TH1F * fRecoCheck2dTimeTickPlane1
TH1F * fTwoDWireInCmPlane1
TH2D * fRecoCheck3dVtxYvsY
EventNumber_t event() const
TH1F * fRecoCheck2dWireInCmPlane0
TH1F * fTwoDWireInCmPlane0
TH1F * fTruthWireInCmPlane0
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
TH1F * fTruthWireNumberPlane1
TH1F * fTwoDWireInCmPlane2
Tools and modules for checking out the basics of the Monte Carlo.
art framework interface to geometry description
TH1F * fTruthTimeInCmPlane2
TH1F * fTwoDWireNumberPlane0
Encapsulate the construction of a single detector plane.
virtual double GetXTicksOffset(int p, int t, int c) const =0