29 #include "art_root_io/TFileService.h" 139 fRun = tfs->make<TH1F>(
"fRun",
"Run Number", 1000, 0, 1000);
140 fEvt = tfs->make<TH1F>(
"fEvt",
"Event Number", 1000, 0, 1000);
141 fTruthVtxXPos = tfs->make<TH1F>(
"fTruthVtxXPos",
"Truth Vertex X Position", 400, 0, 200);
142 fTruthVtxYPos = tfs->make<TH1F>(
"fTruthVtxYPos",
"Truth Vertex Y Position", 400, -100, 100);
143 fTruthVtxZPos = tfs->make<TH1F>(
"fTruthVtxZPos",
"Truth Vertex Z Position", 2000, 0, 1000);
145 tfs->make<TH1F>(
"fTruthWireNumberPlane0",
"Truth Wire Number Plane 0", 3000, 0, 3000);
147 tfs->make<TH1F>(
"fTruthTimeTickPlane0",
"Truth Time Tick Plane 0", 3200, 0, 3200);
149 tfs->make<TH1F>(
"fTruthWireNumberPlane1",
"Truth Wire Number Plane 1", 3000, 0, 3000);
151 tfs->make<TH1F>(
"fTruthTimeTickPlane1",
"Truth Time Tick Plane 1", 3200, 0, 3200);
153 tfs->make<TH1F>(
"fTruthWireNumberPlane2",
"Truth Wire Number Plane 2", 3000, 0, 3000);
155 tfs->make<TH1F>(
"fTruthTimeTickPlane2",
"Truth Time Tick Plane 2", 3200, 0, 3200);
157 tfs->make<TH1F>(
"fTruthWireInCmPlane0",
"Truth Wire In CM Plane 0", 2000, 0, 1000);
159 tfs->make<TH1F>(
"fTruthTimeInCmPlane0",
"Truth Time In Cm Plane 0", 2000, 0, 1000);
161 tfs->make<TH1F>(
"fTruthWireInCmPlane1",
"Truth Wire In CM Plane 1", 2000, 0, 1000);
163 tfs->make<TH1F>(
"fTruthTimeInCmPlane1",
"Truth Time In Cm Plane 1", 2000, 0, 1000);
165 tfs->make<TH1F>(
"fTruthWireInCmPlane2",
"Truth Wire In CM Plane 2", 2000, 0, 1000);
167 tfs->make<TH1F>(
"fTruthTimeInCmPlane2",
"Truth Time In Cm Plane 2", 2000, 0, 1000);
170 tfs->make<TH1F>(
"fTwoDNVtxPlane0",
"TwoD Number of Verticies Found in Plane 0", 400, 0, 200);
172 tfs->make<TH1F>(
"fTwoDNVtxPlane1",
"TwoD Number of Verticies Found in Plane 1", 400, 0, 200);
174 tfs->make<TH1F>(
"fTwoDNVtxPlane2",
"TwoD Number of Verticies Found in Plane 2", 400, 0, 200);
177 tfs->make<TH1F>(
"fTwoDWireNumberPlane0",
"TwoD Wire Number Plane 0", 3000, 0, 3000);
179 tfs->make<TH1F>(
"fTwoDTimeTickPlane0",
"TwoD Time Tick Plane 0", 3200, 0, 3200);
181 tfs->make<TH1F>(
"fTwoDWireNumberPlane1",
"TwoD Wire Number Plane 1", 3000, 0, 3000);
183 tfs->make<TH1F>(
"fTwoDTimeTickPlane1",
"TwoD Time Tick Plane 1", 3200, 0, 3200);
185 tfs->make<TH1F>(
"fTwoDWireNumberPlane2",
"TwoD Wire Number Plane 2", 3000, 0, 3000);
187 tfs->make<TH1F>(
"fTwoDTimeTickPlane2",
"TwoD Time Tick Plane 2", 3200, 0, 3200);
189 tfs->make<TH1F>(
"fTwoDWireInCmPlane0",
"TwoD Wire In CM Plane 0", 2000, 0, 1000);
191 tfs->make<TH1F>(
"fTwoDTimeInCmPlane0",
"TwoD Time In Cm Plane 0", 2000, 0, 1000);
193 tfs->make<TH1F>(
"fTwoDWireInCmPlane1",
"TwoD Wire In CM Plane 1", 2000, 0, 1000);
195 tfs->make<TH1F>(
"fTwoDTimeInCmPlane1",
"TwoD Time In Cm Plane 1", 2000, 0, 1000);
197 tfs->make<TH1F>(
"fTwoDWireInCmPlane2",
"TwoD Wire In CM Plane 2", 2000, 0, 1000);
199 tfs->make<TH1F>(
"fTwoDTimeInCmPlane2",
"TwoD Time In Cm Plane 2", 2000, 0, 1000);
202 tfs->make<TH1F>(
"fTwoDStrengthPlane0",
"TwoD Strength Plane 0", 1000, 0, 500);
204 tfs->make<TH1F>(
"fTwoDStrengthPlane1",
"TwoD Strength Plane 1", 1000, 0, 500);
206 tfs->make<TH1F>(
"fTwoDStrengthPlane2",
"TwoD Strength Plane 2", 1000, 0, 500);
209 "fRecoCheck2dWireNumPlane0",
"Reco Wire Number - True Wire Number Plane 0", 400, -200, 200);
211 "fRecoCheck2dTimeTickPlane0",
"Reco Time Tick - True Time Tick Plane 0", 1000, -500, 500);
213 "fRecoCheck2dWireInCmPlane0",
"Reco Wire in CM - True Wire in CM Plane 0", 200, -50, 50);
215 "fRecoCheck2dTimeInCmPlane0",
"Reco Time in CM - True Time in CM Plane 0", 200, -50, 50);
218 "fRecoCheck2dWireNumPlane1",
"Reco Wire Number - True Wire Number Plane 1", 400, -200, 200);
220 "fRecoCheck2dTimeTickPlane1",
"Reco Time Tick - True Time Tick Plane 1", 1000, -500, 500);
222 "fRecoCheck2dWireInCmPlane1",
"Reco Wire in CM - True Wire in CM Plane 1", 200, -50, 50);
224 "fRecoCheck2dTimeInCmPlane1",
"Reco Time in CM - True Time in CM Plane 1", 200, -50, 50);
227 "fRecoCheck2dWireNumPlane2",
"Reco Wire Number - True Wire Number Plane 2", 400, -200, 200);
229 "fRecoCheck2dTimeTickPlane2",
"Reco Time Tick - True Time Tick Plane 2", 1000, -500, 500);
231 "fRecoCheck2dWireInCmPlane2",
"Reco Wire in CM - True Wire in CM Plane 2", 200, -50, 50);
233 "fRecoCheck2dTimeInCmPlane2",
"Reco Time in CM - True Time in CM Plane 2", 200, -50, 50);
235 fRecoVtxN3d = tfs->make<TH1F>(
"fRecoVtxN3d",
"Number of 3d-Reco Verticies", 400, 0, 200);
236 fRecoVtxXPos = tfs->make<TH1F>(
"fRecoVtxXPos",
"Reco Vertex X Position", 400, -10, 200);
237 fRecoVtxYPos = tfs->make<TH1F>(
"fRecoVtxYPos",
"Reco Vertex Y Position", 400, -100, 100);
238 fRecoVtxZPos = tfs->make<TH1F>(
"fRecoVtxZPos",
"Reco Vertex Z Position", 2000, -10, 1000);
241 tfs->make<TH1F>(
"fRecoCheck3dVtxX",
"Reco X Position - True X Postion", 800, -100, 100);
243 tfs->make<TH1F>(
"fRecoCheck3dVtxY",
"Reco Y Position - True Y Postion", 800, -100, 100);
245 tfs->make<TH1F>(
"fRecoCheck3dVtxZ",
"Reco Z Position - True Z Postion", 800, -100, 100);
248 "fRecoCheck3dVtxXvsX",
"(Reco X - True X)/True X vs True X", 400, -10, 200, 120, -20, 20);
250 "fRecoCheck3dVtxYvsY",
"(Reco Y - True Y)/True Y vs True Y", 400, -100, 100, 120, -20, 20);
252 "fRecoCheck3dVtxZvsZ",
"(Reco Z - True Z)/True Z vs True Z", 1000, -10, 1000, 120, -20, 20);
272 auto const clock_data =
274 auto const det_prop =
286 std::vector<double> WirePitch_CurrentPlane(geom->
Views().size(),
291 for (
auto v : geom->
Views()) {
292 WirePitch_CurrentPlane[vn] = geom->
WirePitch(v);
299 float DriftVelocity = det_prop.DriftVelocity(det_prop.Efield(), det_prop.Temperature());
300 float TimetoCm = TimeTick * DriftVelocity;
307 uint32_t VtxWireNum[3] = {0};
308 double VtxTimeTick[3] = {0.};
310 double VtxWireNum_InCM[3] = {0.};
311 double VtxTimeTick_InCM[3] = {0.};
319 for (std::size_t i = 0; i != mctruthList.size(); ++i) {
320 auto const& neut = mctruthList[i].GetParticle(i);
321 truth_vertex.SetX(neut.Vx());
322 truth_vertex.SetY(neut.Vy());
323 truth_vertex.SetZ(neut.Vz());
338 mf::LogWarning(
"FeatureVertexFinderAna") <<
"Can't find nearest wire";
341 VtxTimeTick[
pid.Plane] =
342 det_prop.ConvertXToTicks(truth_vertex.X(),
pid) + det_prop.GetXTicksOffset(
pid);
345 VtxWireNum_InCM[
pid.Plane] = VtxWireNum[
pid.Plane] * WirePitch_CurrentPlane[
pid.Plane];
346 VtxTimeTick_InCM[
pid.Plane] = VtxTimeTick[
pid.Plane] * TimetoCm;
369 double Vertex2d_TimeTick[10000] = {
371 double Vertex2d_Wire[10000] = {0.};
373 double Vertex2d_TimeTick_InCM[10000] = {0.};
374 double Vertex2d_Wire_InCM[10000] = {0.};
377 int n2dVtxPlane0 = 0, n2dVtxPlane1 = 0, n2dVtxPlane2 = 0;
379 bool vertexWstrengthplane0 =
false,
380 vertexWstrengthplane1 =
384 for (
size_t ii = 0; ii < vertex2dHandle->size(); ++ii) {
390 if (vert2d.
size() > 0) {
394 for (
size_t ww = 0; ww < vert2d.
size(); ++ww) {
396 if (vert2d[ww]->
WireID().planeID() !=
pid) {
continue; }
398 Vertex2d_TimeTick[n2dVtx] = vert2d[ww]->DriftTime();
399 Vertex2d_Wire[n2dVtx] = vert2d[ww]->WireID().Wire;
402 Vertex2d_Wire_InCM[n2dVtx] = Vertex2d_Wire[n2dVtx] * WirePitch_CurrentPlane[
pid.Plane];
403 Vertex2d_TimeTick_InCM[n2dVtx] = Vertex2d_TimeTick[n2dVtx] * TimetoCm;
407 float RecoCheck_TimeTick = Vertex2d_TimeTick[n2dVtx] - VtxTimeTick[
pid.Plane];
408 float RecoCheck_WireNum = Vertex2d_Wire[n2dVtx] - VtxWireNum[
pid.Plane];
410 float RecoCheck_TimeInCm = Vertex2d_TimeTick_InCM[n2dVtx] - VtxTimeTick_InCM[
pid.Plane];
411 float RecoCheck_WireInCm = Vertex2d_Wire_InCM[n2dVtx] - VtxWireNum_InCM[
pid.Plane];
413 if (vert2d[ww]->Strength() > -1) {
414 if (
pid.Plane == 0) {
415 vertexWstrengthplane0 =
true;
433 if (
pid.Plane == 1) {
434 vertexWstrengthplane1 =
true;
451 if (
pid.Plane == 2) {
483 double xyz[3] = {0.};
485 for (
unsigned int ii = 0; ii < vertex3dListHandle->size(); ++ii) {
491 if (Vertexlist.
size() > 0 && vertexWstrengthplane0 && vertexWstrengthplane1) {
494 for (
unsigned int ww = 0; ww < Vertexlist.
size(); ww++) {
495 Vertexlist[ww]->XYZ(xyz);
500 double DeltaX = xyz[0] - truth_vertex.X();
501 double DeltaY = xyz[1] - truth_vertex.Y();
502 double DeltaZ = xyz[2] - truth_vertex.Z();
504 double DeltaXoverTrueX = DeltaX / truth_vertex.X();
505 double DeltaYoverTrueY = DeltaY / truth_vertex.X();
506 double DeltaZoverTrueZ = DeltaZ / truth_vertex.X();
TH1F * fTwoDTimeInCmPlane2
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
TH2D * fRecoCheck3dVtxXvsX
TH1F * fTwoDTimeTickPlane2
std::string fEndPoint2dModuleLabel
TH1F * fTwoDTimeInCmPlane0
TH1F * fTwoDTimeInCmPlane1
TH1F * fTruthTimeInCmPlane0
TH1F * fTwoDWireNumberPlane1
TH1F * fTruthWireNumberPlane0
TH1F * fTruthTimeTickPlane2
std::string fVertexModuleLabel
TH1F * fTwoDWireNumberPlane2
TH1F * fRecoCheck2dWireNumPlane1
The data type to uniquely identify a Plane.
TH1F * fTruthWireInCmPlane2
void analyze(const art::Event &evt) override
WireID_t Wire
Index of the wire within its plane.
TH1F * fTruthWireInCmPlane1
EDAnalyzer(fhicl::ParameterSet const &pset)
TH1F * fRecoCheck2dTimeInCmPlane2
TH1F * fTwoDStrengthPlane2
TH1F * fTruthTimeInCmPlane1
TH1F * fRecoCheck2dTimeInCmPlane1
TH1F * fRecoCheck2dTimeTickPlane2
std::string fGenieModuleLabel
TH1F * fRecoCheck2dTimeTickPlane0
std::string fLArG4ModuleLabel
TH2D * fRecoCheck3dVtxZvsZ
FeatureVertexFinderAna(fhicl::ParameterSet const &pset)
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
TH1F * fRecoCheck2dWireInCmPlane2
void push_back(Ptr< U > const &p)
TH1F * fTwoDStrengthPlane0
TH1F * fTwoDStrengthPlane1
TH1F * fTwoDTimeTickPlane0
T get(std::string const &key) const
TH1F * fTwoDTimeTickPlane1
TH1F * fTruthTimeTickPlane0
TH1F * fRecoCheck2dWireNumPlane2
TH1F * fTruthWireNumberPlane2
TH1F * fRecoCheck2dTimeInCmPlane0
TH1F * fRecoCheck2dWireNumPlane0
TH1F * fTruthTimeTickPlane1
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
WireID NearestWireID(Point_t const &point, PlaneID const &planeid) const
Returns the ID of wire closest to position in the specified TPC.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
TH1F * fRecoCheck2dWireInCmPlane1
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
TH1F * fRecoCheck2dTimeTickPlane1
TH1F * fTwoDWireInCmPlane1
TH2D * fRecoCheck3dVtxYvsY
std::set< View_t > const & Views() const
Returns a list of possible views in the detector.
EventNumber_t event() const
TH1F * fRecoCheck2dWireInCmPlane0
TH1F * fTwoDWireInCmPlane0
TH1F * fTruthWireInCmPlane0
TH1F * fTruthWireNumberPlane1
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
TH1F * fTwoDWireInCmPlane2
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
art framework interface to geometry description
TH1F * fTruthTimeInCmPlane2
TH1F * fTwoDWireNumberPlane0