27 #include "Utilities/func/MathUtil.h" 29 #include "RunHistory/RunHistory.h" 148 double napdbins = nwbins;
150 double apdmax = 1600;
157 double cellmin = -0.5;
158 double cellmax = 384*(double)
fplanemax+0.5;
162 nwbins,wmin,wmax,nlbins,lmin,lmax);
164 nwbins,wmin,wmax,nlbins,lmin,lmax);
168 nwbins,wmin,wmax,nlbins,lmin,lmax);
170 nwbins,wmin,wmax,nlbins,lmin,lmax);
174 napdbins,apdmin,apdmax,nlbins,lmin,lmax);
176 napdbins,apdmin,apdmax,nlbins,lmin,lmax);
180 napdbins,apdmin,apdmax,nlbins,lmin,lmax);
182 napdbins,apdmin,apdmax,nlbins,lmin,lmax);
187 ncellbins,cellmin,cellmax,nwbins,wmin,wmax);
189 ncellbins,cellmin,cellmax,nwbins,wmin,wmax);
194 ncellbins,cellmin,cellmax,napdbins,apdmin,apdmax);
196 ncellbins,cellmin,cellmax,napdbins,apdmin,apdmax);
201 ncellbins,cellmin,cellmax,nwbins,wmin,wmax);
203 ncellbins,cellmin,cellmax,nwbins,wmin,wmax);
207 ncellbins,cellmin,cellmax,napdbins,apdmin,apdmax);
209 ncellbins,cellmin,cellmax,napdbins,apdmin,apdmax);
211 NEvents = tfs->
make<TH1F>(
"NEvents",
";NEvents;",1,-0.5,0.5);
221 int planemax = geom->
NPlanes()-1;
228 double zfront1,zback1,zfront2,zback2;
263 for(
unsigned int i = 0;
i<trackcol->size(); ++
i){
269 for(
unsigned int itr = 0; itr < tracks.
size(); ++itr){
275 int nxhit = track->
NXCell();
276 int nyhit = track->
NYCell();
279 TVector3
dir = track->
Dir();
283 if( dx > 1.0 || dx < -1.0 ||
284 dy > 1.0 || dy < -1.0 ||
285 dz > 1.0 || dz < -1.0){
continue; }
288 unsigned int minplane = track->
MinPlane();
289 unsigned int maxplane = track->
MaxPlane();
291 if((maxplane - minplane) <
fNPlanes){
continue; }
296 TVector3 stop = track->
Stop();
297 double ix = start.X();
298 double iy = start.Y();
299 double iz = start.Z();
300 double fx = stop.X();
301 double fy = stop.Y();
302 double fz = stop.Z();
310 if(
fabs(ix) < xmax &&
fabs(iy) < ymax && iz > zmin && iz < zmax){
continue; }
311 if(
fabs(fx) < xmax &&
fabs(fy) < ymax && fz > zmin && fz < zmax){
continue; }
320 std::vector<geo::OfflineChan> allcellsontrack, ycellsontrack;
323 for(
unsigned int i = 0;
i < ycellsontrack.size(); ++
i){
324 allcellsontrack.push_back(ycellsontrack[
i]);
328 std::vector<geo::OfflineChan> tricells;
329 for(
unsigned int icell = 0; icell < allcellsontrack.size(); ++icell){
332 geom->
Plane(allcellsontrack[icell].Plane())->
Cell(allcellsontrack[icell].Cell())->
GetCenter(zcent);
335 int plane = allcellsontrack[icell].Plane();
336 int cellmin = allcellsontrack[icell].Cell()-1;
337 int cellmax = allcellsontrack[icell].Cell()+1;
340 for(
unsigned int ihit = 0; ihit < trkhits.
size(); ++ihit){
341 if(trkhits[ihit]->Plane() <
plane){
continue; }
342 if(trkhits[ihit]->Plane() >
plane){
break; }
344 if(trkhits[ihit]->Cell() == cellmax){ topok =
true; }
345 else if(trkhits[ihit]->Cell() == cellmin){ botok =
true; }
347 if(topok && botok){ tricells.push_back(allcellsontrack[icell]); }
351 for(
unsigned int icell = 0; icell < tricells.size(); ++icell){
353 unsigned int cell = tricells[icell].Cell();
354 unsigned int plane = tricells[icell].Plane();
373 if(!enable){
continue; }
379 double deltax,deltay,deltaz,
w;
382 deltay = (dy/
dx)*deltax;
383 deltaz = (dz/
dx)*deltax;
385 w = (xyz[2]-iz)*dy/dz + iy;
389 deltax = (dx/
dy)*deltay;
390 deltaz = (dz/
dy)*deltay;
392 w = (xyz[2]-iz)*dx/dz + ix;
395 double tripath =
sqrt(deltax*deltax+deltay*deltay+deltaz*deltaz);
400 for(
unsigned int ihit = 0; ihit < trkhits.
size(); ++ihit){
401 if(trkhits[ihit]->Cell() == cell && trkhits[ihit]->Plane() ==
plane){
408 int cellbin = 384*plane+
cell;
virtual geo::View_t View() const
kXorY for 3D clusters.
void analyze(art::Event const &e)
void GetCenter(double *xyz, double localz=0.0) const
std::map< std::string, double > xmax
fvar< T > fabs(const fvar< T > &x)
const CellGeo * Cell(int icell) const
Vertical planes which measure X.
const PlaneGeo * Plane(unsigned int i) const
DEFINE_ART_MODULE(TestTMapFile)
virtual TVector3 Start() const
TH2F * hitsVapddistcelllencut
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
void reconfigure(fhicl::ParameterSet const &p)
void CountCellsOnLine(double X1, double Y1, double Z1, double X2, double Y2, double Z2, std::vector< OfflineChan > &Xhitsonline, std::vector< OfflineChan > &Yhitsonline)
View_t View() const
Which coordinate does this plane measure.
void push_back(Ptr< U > const &p)
T get(std::string const &key) const
virtual TVector3 Dir() const
Unit vector describing prong direction.
TH2F * cellsVapddistVleny
double DetHalfHeight() const
EDAnalyzer(Table< Config > const &config)
TH2F * cellsVapddistcelllencut
nova::dbi::RunHistory frunhist
unsigned int NYCell() const
Number of cells in the y-view.
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
void beginRun(art::Run const &r)
T * make(ARGS...args) const
double DetHalfWidth() const
HitEfficiency(fhicl::ParameterSet const &p)
double DistToElectronics(double localz, const CellGeo &cell) const
get distance from local z position in cell to apd in cm, including pigtail
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
unsigned int NXCell() const
Number of cells in the x-view.
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
TH2F * cellsVapddistVlenx
unsigned int NPlanes() const
TVector3 Stop() const
Position of the final trajectory point.
int InstrumentedDetEnds(double &frontDwnstrm, double &backDwnstrm, double &frontUpstrm, double &backUpstrm)
give all detector ends information; most general
Encapsulate the geometry of one entire detector (near, far, ndos)
void SortByPlane(std::vector< art::Ptr< rb::CellHit > > &c)
Sort c in plane order (low to high).