19 #include "art_root_io/TFileService.h" 108 auto const* MagField = MagFieldHandle->
provider();
109 double Efield = detProp.Efield();
110 double Temperature = detProp.Temperature();
111 double DriftVelocity = detProp.DriftVelocity(Efield, Temperature) / 1000.;
116 fDirCosY = -DriftVelocity * MagField->FieldAtPoint().z() / Efield;
117 fDirCosZ = +DriftVelocity * MagField->FieldAtPoint().y() / Efield;
125 auto const& tpc_0 = geom->
TPC();
127 double halfHeight = tpc_0.HalfHeight();
128 double length = tpc_0.Length();
130 double zScale = std::max(fDirCosZ / 2.0, 4
e-4);
134 tfs->make<TH1D>(
"hChargeXpos",
"MC X charge depositions; X (cm); Events", 101, 0.0, width);
136 "hChargeYpos",
"MC Y charge depositions; Y (cm); Events", 101, -halfHeight, halfHeight);
138 tfs->make<TH1D>(
"hChargeZpos",
"MC Z charge depositions; Z (cm); Events", 101, 0.0, length);
139 fHitZpos = tfs->make<TH1D>(
"hHitZpos",
"Z charge collection; Z (cm); Events", 101, 0.0, length);
142 "Z drift of charge; delta Z (cm); Events",
147 "hDeltaZoverX",
"Z drift of charge; delta Z/X; Events", 51, -10 * zScale, 10 * zScale);
149 "delta Z vs X; X (cm); delta Z (cm), Events",
159 "Z drift of charge (long drift); delta Z (cm); Events",
164 "Z drift of charge (long drift); delta Z/X; Events",
176 l->SetLineColor(kRed);
177 l->SetLineStyle(kDotted);
185 l->SetLineColor(kRed);
186 l->SetLineStyle(kDotted);
194 throw cet::exception(
"MagDriftAna: ") <<
"Not for use on Data yet...\n";
211 std::vector<art::Ptr<recob::Hit>>
hits;
219 for (
auto itr : hits) {
221 hitWireID = itr->
WireID();
230 double HitZpos = w0pos.Z() + hitWireID.
Wire * geom->
TPC(hitWireID).
WirePitch();
231 double Charge = itr->Integral();
235 std::vector<double> xyz = bt_serv->
HitToXYZ(clockData, itr);
238 double ChargeZpos = xyz[2];
245 double DeltaZ = HitZpos - ChargeZpos;
252 if (xyz[0] > (
fChargeYpos->GetXaxis()->GetXmax() * 0.80)) {
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
void analyze(const art::Event &evt) override
WireGeo const & Wire(unsigned int iwire) const
Declaration of signal hit object.
std::string fLArG4ModuleLabel
std::string fFFTHitFinderModuleLabel
WireID_t Wire
Index of the wire within its plane.
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Base class for creation of raw signals on wires.
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
virtual const mag::MagneticField * provider() const =0
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
double WirePitch(unsigned plane=0) const
Returns the center of the TPC volume in world coordinates [cm].
PlaneID_t Plane
Index of the plane within its TPC.
MagDriftAna(fhicl::ParameterSet const &pset)
Detector simulation of raw signals on wires.
Encapsulate the geometry of a wire.
void ensureHists(art::Event const &evt, detinfo::DetectorClocksData const &clockData)
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Encapsulate the construction of a single detector plane.
Contains all timing reference information for the detector.
#define MF_LOG_VERBATIM(category)
constexpr WireID()=default
Default constructor: an invalid TPC ID.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
art framework interface to geometry description
double HalfWidth() const
Width is associated with x coordinate [cm].
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane.