18 #include <sys/types.h> 54 namespace geo {
class Geometry; }
155 double Efield = detprop->
Efield();
157 double DriftVelocity = detprop->
DriftVelocity(Efield,Temperature)/1000.;
162 fDirCosY = -DriftVelocity * MagField->FieldAtPoint().z() / Efield;
163 fDirCosZ = +DriftVelocity * MagField->FieldAtPoint().y() / Efield;
176 double zScale =
std::max(fDirCosZ/2.0,4
e-4);
180 "MC X charge depositions; X (cm); Events",
183 "MC Y charge depositions; Y (cm); Events",
184 101, -halfHeight, halfHeight);
186 "MC Z charge depositions; Z (cm); Events",
189 "Z charge collection; Z (cm); Events",
193 "Z drift of charge; delta Z (cm); Events",
194 101, -5*zScale*width, 5*zScale*width);
196 "Z drift of charge; delta Z/X; Events",
197 51, -10*zScale, 10*zScale);
199 "delta Z vs X; X (cm); delta Z (cm), Events",
201 51, -20*zScale, 20*zScale);
205 tfs->
make<TH1D>(
"hDriftDeltaZAway",
206 "Z drift of charge (long drift); delta Z (cm); Events",
207 101, -5*zScale*width, 5*zScale*width);
209 tfs->
make<TH1D>(
"hDeltaZoverXAway",
210 "Z drift of charge (long drift); delta Z/X; Events",
211 51, -10*zScale, 10*zScale);
224 l->SetLineColor(kRed);
225 l->SetLineStyle(kDotted);
236 l->SetLineColor(kRed);
237 l->SetLineStyle(kDotted);
246 throw cet::exception(
"MagDriftAna: ") <<
"Not for use on Data yet...\n";
266 std::vector< art::Ptr<recob::Hit> >
hits;
276 for (
auto itr : hits) {
278 hitWireID = itr->
WireID();
286 double w0pos[3] = {0.};
289 double Charge = itr->Integral();
293 std::vector<double> xyz = bt_serv->
HitToXYZ(itr);
296 double ChargeZpos = xyz[2];
309 double DeltaZ = HitZpos-ChargeZpos;
316 if (xyz[0] > (
fChargeYpos->GetXaxis()->GetXmax() * 0.80) ) {
void analyze(const art::Event &evt)
read/write access to event
const std::vector< double > HitToXYZ(const recob::Hit &hit)
WireGeo const & Wire(unsigned int iwire) const
Declaration of signal hit object.
std::string fLArG4ModuleLabel
std::string fFFTHitFinderModuleLabel
void reconfigure(fhicl::ParameterSet const &p)
WireID_t Wire
Index of the wire within its plane.
Describe the magnetic field structure of a detector.
double Length() const
Length is associated with z coordinate [cm].
Base class for creation of raw signals on wires.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
#define DEFINE_ART_MODULE(klass)
Provides recob::Track data product.
virtual double Temperature() const =0
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.
std::string fTrackFinderModuleLabel
Detector simulation of raw signals on wires.
Encapsulate the geometry of a wire.
double HalfHeight() const
Height is associated with y coordinate [cm].
T * make(ARGS...args) const
Encapsulate the construction of a single detector plane.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
#define LOG_VERBATIM(category)
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
WireID()=default
Default constructor: an invalid TPC ID.
Namespace collecting geometry-related classes utilities.
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.