145 ,
fUseMC(pset.get<
bool>("UseMC"))
146 ,
fMinX(pset.get<
double>("MinX", -1.e10))
147 ,
fMaxX(pset.get<
double>("MaxX", 1.e10))
148 ,
fMinY(pset.get<
double>("MinY", -1.e10))
149 ,
fMaxY(pset.get<
double>("MaxY", 1.e10))
150 ,
fMinZ(pset.get<
double>("MinZ", -1.e10))
151 ,
fMaxZ(pset.get<
double>("MaxZ", 1.e10))
194 <<
"SpacePointAna configured with the following parameters:\n" 219 unsigned int nwiresU=0, nwiresV=0, nwiresW=0;
225 for(
unsigned int cstat = 0; cstat < geom->
Ncryostats(); ++cstat){
228 unsigned int const ntpc = cryogeom.
NTPC();
230 for(
unsigned int tpc = 0; tpc < ntpc; ++tpc) {
233 unsigned int const nplane = tpcgeom.
Nplanes();
235 for(
unsigned int plane = 0; plane < nplane; ++plane) {
238 unsigned int nwires = pgeom.
Nwires();
254 fHDTUE = dir.
make<TH1F>(
"MCDTUE",
"U-Drift Electrons Time Difference", 100, -5., 5.);
255 fHDTVE = dir.
make<TH1F>(
"MCDTVE",
"V-Drift Electrons Time Difference", 100, -5., 5.);
256 fHDTWE = dir.
make<TH1F>(
"MCDTWE",
"W-Drift Electrons Time Difference", 100, -5., 5.);
257 fHDTUPull = dir.
make<TH1F>(
"MCDTUPull",
"U-Drift Electrons Time Pull", 100, -50., 50.);
258 fHDTVPull = dir.
make<TH1F>(
"MCDTVPull",
"V-Drift Electrons Time Pull", 100, -50., 50.);
259 fHDTWPull = dir.
make<TH1F>(
"MCDTWPull",
"W-Drift Electrons Time Pull", 100, -50., 50.);
262 fHDTUV = dir.
make<TH1F>(
"DTUV",
"U-V time difference", 100, -20., 20.);
263 fHDTVW = dir.
make<TH1F>(
"DTVW",
"V-W time difference", 100, -20., 20.);
264 fHDTWU = dir.
make<TH1F>(
"DTWU",
"W-U time difference", 100, -20., 20.);
265 fHDTUVU = dir.
make<TH2F>(
"DTUVU",
"U-V time difference vs. U",
266 100, 0., double(nwiresU), 100, -20., 20.);
267 fHDTUVV = dir.
make<TH2F>(
"DTUVV",
"U-V time difference vs. V",
268 100, 0., double(nwiresV), 100, -20., 20.);
269 fHDTVWV = dir.
make<TH2F>(
"DTVWV",
"V-W time difference vs. V",
270 100, 0., double(nwiresV), 100, -20., 20.);
271 fHDTVWW = dir.
make<TH2F>(
"DTVWW",
"V-W time difference vs. W",
272 100, 0., double(nwiresW), 100, -20., 20.);
273 fHDTWUW = dir.
make<TH2F>(
"DTWUW",
"W-U time difference vs. W",
274 100, 0., double(nwiresW), 100, -20., 20.);
275 fHDTWUU = dir.
make<TH2F>(
"DTWUU",
"W-U time difference vs. U",
276 100, 0., double(nwiresU), 100, -20., 20.);
277 fHS = dir.
make<TH1F>(
"DS",
"Spatial Separation", 100, -2., 2.);
279 fHchisq = dir.
make<TH1F>(
"chisq",
"Chisquare", 100, 0., 20.);
281 fHx = dir.
make<TH1F>(
"xpos",
"X Position",
283 fHy = dir.
make<TH1F>(
"ypos",
"Y Position",
285 fHz = dir.
make<TH1F>(
"zpos",
"Z Position",
287 fHAmpU = dir.
make<TH1F>(
"ampU",
"U Hit Amplitude", 50, 0., 50.);
288 fHAmpV = dir.
make<TH1F>(
"ampV",
"V Hit Amplitude", 50, 0., 50.);
289 fHAmpW = dir.
make<TH1F>(
"ampW",
"W Hit Amplitude", 50, 0., 50.);
290 fHAreaU = dir.
make<TH1F>(
"areaU",
"U Hit Area", 100, 0., 500.);
291 fHAreaV = dir.
make<TH1F>(
"areaV",
"V Hit Area", 100, 0., 500.);
292 fHAreaW = dir.
make<TH1F>(
"areaW",
"W Hit Area", 100, 0., 500.);
293 fHSumU = dir.
make<TH1F>(
"sumU",
"U Hit Sum ADC", 100, 0., 500.);
294 fHSumV = dir.
make<TH1F>(
"sumV",
"V Hit Sum ADC", 100, 0., 500.);
295 fHSumW = dir.
make<TH1F>(
"sumW",
"W Hit Sum ADC", 100, 0., 500.);
297 fHMCdx = dir.
make<TH1F>(
"MCdx",
"X MC Residual", 100, -1., 1.);
298 fHMCdy = dir.
make<TH1F>(
"MCdy",
"Y MC Residual", 100, -1., 1.);
299 fHMCdz = dir.
make<TH1F>(
"MCdz",
"Z MC Residual", 100, -1., 1.);
300 fHMCxpull = dir.
make<TH1F>(
"MCxpull",
"X MC Pull", 100, -50., 50.);
301 fHMCypull = dir.
make<TH1F>(
"MCypull",
"Y MC Pull", 100, -50., 50.);
302 fHMCzpull = dir.
make<TH1F>(
"MCzpull",
"Z MC Pull", 100, -50., 50.);
341 int nclus = clusterh->size();
343 for(
int i = 0; i < nclus; ++i) {
345 std::vector< art::Ptr<recob::Hit> > clushits = fm.at(i);
346 int nhits = clushits.size();
347 hits.reserve(hits.size() + nhits);
350 hits.push_back(*ihit);
362 int nhits = hith->size();
365 for(
int i = 0; i < nhits; ++i)
379 ihit != hits.end(); ++ihit) {
422 std::vector<double> hitxyz = bt_serv->
HitToXYZ(*ihit);
423 tav = detprop->
ConvertXToTicks(hitxyz[0], (*ihit)->WireID().Plane, (*ihit)->WireID().TPC, (*ihit)->WireID().Cryostat);
429 if((*ihit)->View() ==
geo::kU) {
430 fHDTUE->Fill(tpeak - tav);
433 else if((*ihit)->View() ==
geo::kV) {
434 fHDTVE->Fill(tpeak - tav);
437 else if((*ihit)->View() ==
geo::kZ) {
438 fHDTWE->Fill(tpeak - tav);
442 throw cet::exception(
"SpacePointAna") <<
"Bad view = " << (*ihit)->View() <<
"\n";
447 std::vector<recob::SpacePoint> spts1;
448 std::vector<recob::SpacePoint> spts2;
449 std::vector<recob::SpacePoint> spts3;
462 LOG_DEBUG(
"SpacePointAna") <<
"Found " << spts1.size()
463 <<
" space points using special time cut.";
477 LOG_DEBUG(
"SpacePointAna") <<
"Found " << spts2.size()
478 <<
" space points using special seperation cut.";
490 LOG_DEBUG(
"SpacePointAna") <<
"Found " << spts3.size()
491 <<
" space points using default cuts.";
498 i != spts1.end(); ++i) {
512 ihit != spthits.
end(); ++ihit) {
516 unsigned int tpc1, plane1, wire1;
517 tpc1 = hit1WireID.
TPC;
518 plane1 = hit1WireID.
Plane;
519 wire1 = hit1WireID.
Wire;
525 jhit != spthits.
end(); ++jhit) {
529 unsigned int tpc2, plane2, wire2;
530 tpc2 = hit2WireID.
TPC;
531 plane2 = hit2WireID.
Plane;
532 wire2 = hit2WireID.
Wire;
536 if(tpc1 == tpc2 && plane1 != plane2) {
544 fHDTUVU->Fill(
double(wire1), t1-t2);
545 fHDTUVV->Fill(
double(wire2), t1-t2);
549 fHDTWUW->Fill(
double(wire2), t2-t1);
550 fHDTWUU->Fill(
double(wire1), t2-t1);
556 fHDTVWV->Fill(
double(wire1), t1-t2);
557 fHDTVWW->Fill(
double(wire2), t1-t2);
561 fHDTUVU->Fill(
double(wire2), t2-t1);
562 fHDTUVV->Fill(
double(wire1), t2-t1);
568 fHDTWUW->Fill(
double(wire1), t1-t2);
569 fHDTWUU->Fill(
double(wire2), t1-t2);
573 fHDTVWV->Fill(
double(wire2), t2-t1);
574 fHDTVWW->Fill(
double(wire1), t2-t1);
585 i != spts2.end(); ++i) {
606 i != spts3.end(); ++i) {
620 std::vector<art::Ptr<recob::Hit> > spthits;
622 for(
auto const& ptr : av_spthits ){ spthits.push_back(ptr);}
627 ihit != spthits.end(); ++ihit) {
double correctedTime(const recob::Hit &hit) const
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
const std::vector< double > HitToXYZ(const recob::Hit &hit)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
geo::WireID WireID() const
Initial tdc tick for hit.
unsigned int Nplanes() const
Number of planes in this tpc.
Declaration of signal hit object.
Geometry information for a single TPC.
Planes which measure Z direction.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
geo::View_t View() const
View for the plane of the hit.
WireID_t Wire
Index of the wire within its plane.
Geometry information for a single cryostat.
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
TFileDirectory mkdir(std::string const &dir, std::string const &descr="")
const SpacePointAlg fSptalgSep
void makeMCTruthSpacePoints(const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
virtual double ConvertXToTicks(double X, int p, int t, int c) const =0
float PeakAmplitude() const
The estimated amplitude of the hit at its peak, in ADC units.
double separation(const art::PtrVector< recob::Hit > &hits) const
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
View_t View() const
Which coordinate does this plane measure.
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
#define DEFINE_ART_MODULE(klass)
std::string fHitModuleLabel
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
unsigned int NTPC() const
Number of TPCs in this cryostat.
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
const Double32_t * XYZ() const
EDAnalyzer(Table< Config > const &config)
const Double32_t * ErrXYZ() const
PlaneID_t Plane
Index of the plane within its TPC.
Declaration of cluster object.
const std::vector< double > SpacePointHitsToWeightedXYZ(std::vector< art::Ptr< recob::Hit >> const &hits)
Detector simulation of raw signals on wires.
data_t::const_iterator const_iterator
void makeSpacePoints(const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
float PeakTime() const
Time of the signal peak, in tick units.
T * make(ARGS...args) const
SpacePointAna(fhicl::ParameterSet const &pset)
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
const SpacePointAlg fSptalgTime
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
void analyze(const art::Event &evt)
unsigned int Nwires() const
Number of wires in this plane.
void bookHistograms(bool mc)
float SummedADC() const
The sum of calibrated ADC counts of the hit (0. by default)
const SpacePointAlg fSptalgDefault
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
2D representation of charge deposited in the TDC/wire plane
TPCID_t TPC
Index of the TPC within its cryostat.
Algorithm for generating space points from hits.
std::string fClusterModuleLabel
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane.