58 void endJob()
override;
82 produces< TH2D, art::InRun >(
"dEdx");
83 produces< TH2D, art::InRun >(
"dEdxMinus");
84 produces< TH2D, art::InRun >(
"dEdxPlus");
85 produces< TH2D, art::InRun >(
"dEdxTrue");
98 if( tracks->size() == 0 )
return true;
101 if( !PCHitGetter.isValid() )
return false;
104 for(
unsigned int i=0;
i<tracks->size(); ++
i ){
107 if( (*tracks)[
i].TotalLength() < 200. )
continue;
112 int stopPlaneID = 10000;
113 int firstMuCPlane = -1;
114 bool isNearDet =
false;
119 stopXYZ = (*tracks)[
i].Start();
120 cid = fGeo->
CellId(stopXYZ[0], stopXYZ[1], stopXYZ[2], 1.5, 1.5, 6., 1.0);
123 if(stopPlaneID >= firstMuCPlane)
continue;
127 std::vector<art::Ptr<caldp::PCHit> >
hits = PCHitGetter.at(
i);
128 if( hits.size() == 0 )
continue;
129 for(
unsigned int j=0;
j<hits.size(); ++
j ){
133 if(hits[
j]->Plane() >= firstMuCPlane)
continue;
135 double x = (*tracks)[
i].TotalLength() - hits[
j]->FlightLen();
136 double path = hits[
j]->Path();
137 double trueE = hits[
j]->TrueMeV();
138 double PECorr = this->getPECorr(e,*hits[
j]);
139 fdEdx->Fill(x,PECorr/path);
140 fdEdx_minus->Fill(x-fSysShift,PECorr/path);
141 fdEdx_plus->Fill(x+fSysShift,PECorr/path);
142 fdEdx_true->Fill(x,trueE/path);
165 double pecorr = calibrator->
GetPECorr(cellhit, pchit.
W());
174 fSysShift = pset.
get<
double>(
"SysShift");
181 fdEdx = tfs->
make<TH2D>(
"dEdx",
";Distance to track end (cm);PECorr / cm;",
182 50,0.,500.,200,0.,200.);
183 fdEdx_minus = tfs->
make<TH2D>(
"dEdx_minus",
";Distance to track end (cm);PECorr / cm;",
184 50,0.,500.,200,0.,200.);
185 fdEdx_plus = tfs->
make<TH2D>(
"dEdx_plus",
";Distance to track end (cm);PECorr / cm;",
186 50,0.,500.,200,0.,200.);
187 fdEdx_true = tfs->
make<TH2D>(
"dEdx_true",
";Distance to track end (cm);True MeV / cm;",
188 50,0.,500.,200,0.,5.);
198 std::unique_ptr<TH2D> pdEdx(tfs->
make<TH2D>(*fdEdx));
199 std::unique_ptr<TH2D> pdEdx_minus(tfs->
make<TH2D>(*fdEdx_minus));
200 std::unique_ptr<TH2D> pdEdx_plus(tfs->
make<TH2D>(*fdEdx_plus));
201 std::unique_ptr<TH2D> pdEdx_true(tfs->
make<TH2D>(*fdEdx_true));
203 r.
put(std::move(pdEdx),
"dEdx");
204 r.
put(std::move(pdEdx_minus),
"dEdxMinus");
205 r.
put(std::move(pdEdx_plus),
"dEdxPlus");
206 r.
put(std::move(pdEdx_true),
"dEdxTrue");
210 void MuondEdx::endJob()
float TNS() const
Return uncorrected hit time.
void SetTNS(float tns, bool good)
bool GoodTime() const
Return quality of timing fit for cell.
std::string fStopperLabel
int Cell() const
Return cell value.
art::ProductID put(std::unique_ptr< PROD > &&)
DEFINE_ART_MODULE(TestTMapFile)
"Pre-calibration hit". Common input to calibration procedures
Module that kips a configurable number of events between each that it allows through. Note that this module really skips (N-1) events, it uses a simple modular division as its critera. This module will cut down the data sample to 1/N of its original size.
void SetView(geo::View_t view)
void SetPlane(unsigned short plane)
float W() const
Return W value.
void SetCell(unsigned short cell)
float PE() const
Return PE value.
Encapsulate the geometry of one entire detector (near, far, ndos)
T get(std::string const &key) const
int getPlaneID(const CellUniqueId &id) const
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Near Detector in the NuMI cavern.
const CellUniqueId CellId(const double &x, const double &y, const double &z, double dxds=0., double dyds=0., double dzds=1., double step=0.01) const
int Plane() const
Return plane value.
geo::View_t View() const
Return view.
void SetMC(bool isMC=true)
Histograms used by attenuation calibration.
unsigned long long int CellUniqueId
A rawdata::RawDigit with channel information decoded.
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
double GetPECorr(rb::CellHit const &cellhit, double w)
const unsigned int FirstPlaneInMuonCatcher() const
Returns the index of the first plane contained in the muon catcher.