19 #include "art_root_io/TFileService.h" 109 auto const* MagField = MagFieldHandle->
provider();
110 double Efield = detProp.Efield();
111 double Temperature = detProp.Temperature();
112 double DriftVelocity = detProp.DriftVelocity(Efield, Temperature) / 1000.;
117 fDirCosY = -DriftVelocity * MagField->FieldAtPoint().z() / Efield;
118 fDirCosZ = +DriftVelocity * MagField->FieldAtPoint().y() / Efield;
126 auto const& tpc_0 = geom->
TPC();
128 double halfHeight = tpc_0.HalfHeight();
129 double length = tpc_0.Length();
131 double zScale = std::max(fDirCosZ / 2.0, 4
e-4);
135 tfs->make<TH1D>(
"hChargeXpos",
"MC X charge depositions; X (cm); Events", 101, 0.0, width);
137 "hChargeYpos",
"MC Y charge depositions; Y (cm); Events", 101, -halfHeight, halfHeight);
139 tfs->make<TH1D>(
"hChargeZpos",
"MC Z charge depositions; Z (cm); Events", 101, 0.0, length);
140 fHitZpos = tfs->make<TH1D>(
"hHitZpos",
"Z charge collection; Z (cm); Events", 101, 0.0, length);
143 "Z drift of charge; delta Z (cm); Events",
148 "hDeltaZoverX",
"Z drift of charge; delta Z/X; Events", 51, -10 * zScale, 10 * zScale);
150 "delta Z vs X; X (cm); delta Z (cm), Events",
160 "Z drift of charge (long drift); delta Z (cm); Events",
165 "Z drift of charge (long drift); delta Z/X; Events",
177 l->SetLineColor(kRed);
178 l->SetLineStyle(kDotted);
186 l->SetLineColor(kRed);
187 l->SetLineStyle(kDotted);
195 throw cet::exception(
"MagDriftAna: ") <<
"Not for use on Data yet...\n";
212 std::vector<art::Ptr<recob::Hit>>
hits;
220 for (
auto itr : hits) {
222 hitWireID = itr->
WireID();
225 if (hitWireID.
Plane != (wireReadoutGeom.Nplanes() - 1))
continue;
230 auto const w0pos = wireReadoutGeom.Plane(hitWireID).Wire(0).GetCenter();
233 hitWireID.
Wire * wireReadoutGeom.FirstPlane({hitWireID.
TPC, hitWireID.
Plane}).WirePitch();
234 double Charge = itr->Integral();
238 std::vector<double> xyz = bt_serv->
HitToXYZ(clockData, itr);
241 double ChargeZpos = xyz[2];
248 double DeltaZ = HitZpos - ChargeZpos;
255 if (xyz[0] > (
fChargeYpos->GetXaxis()->GetXmax() * 0.80)) {
void analyze(const art::Event &evt) override
Declaration of signal hit object.
std::string fLArG4ModuleLabel
std::string fFFTHitFinderModuleLabel
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
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)
Base class for creation of raw signals on wires.
virtual const mag::MagneticField * provider() const =0
#define DEFINE_ART_MODULE(klass)
T get(std::string const &key) const
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.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
TPCGeo const & TPC(TPCID const &tpcid=details::tpc_zero) const
Returns the specified TPC.
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 .