Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
align::SplitTracks Class Reference
Inheritance diagram for align::SplitTracks:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 SplitTracks (fhicl::ParameterSet const &pset)
 
virtual ~SplitTracks ()
 
void analyze (art::Event const &evt) override
 
void beginJob () override
 
void ClearVectors ()
 
double DemingRegFit (const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w, double &sigXY, double &sigZ, double &x1, double &y1, double &x2, double &y2, double &sigy1, double &sigy2)
 Find the best-fit line to a collection of points in 2-D using Deming regression. More...
 
TVector3 GeoEstimatePos (art::Ptr< rb::CellHit > cellHit, double W)
 
void GetCellEndpoints (art::Ptr< rb::CellHit > cell, double *cellLo, double *cellHi)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fTrackInLabel
 
int fMinBlocksInTrack
 
unsigned int fMinPlanesInSubCluster
 
trk::TrackAlgfTrkAlg
 
int fTrackAlgEnum
 
TTree * fGeoTree
 
TTree * fOutTree
 
std::vector< double > blockCenterX
 
std::vector< double > blockCenterY
 
std::vector< double > blockCenterZ
 
int trk_ID
 
double trk_StartX
 
double trk_StartY
 
double trk_StartZ
 
double trk_StopX
 
double trk_StopY
 
double trk_StopZ
 
std::vector< intsubtrk_Block
 
std::vector< double > subtrk_StartX
 
std::vector< double > subtrk_StartY
 
std::vector< double > subtrk_StartZ
 
std::vector< double > subtrk_ErrStartX
 
std::vector< double > subtrk_ErrStartY
 
std::vector< double > subtrk_ErrStartZ
 
std::vector< double > subtrk_StopX
 
std::vector< double > subtrk_StopY
 
std::vector< double > subtrk_StopZ
 
std::vector< double > subtrk_ErrStopX
 
std::vector< double > subtrk_ErrStopY
 
std::vector< double > subtrk_ErrStopZ
 
TH1D * xzViewTrkRes
 
TH1D * yzViewTrkRes
 
TH2D * xzViewTrkResVsX
 
TH2D * xzViewTrkResVsZ
 
TH2D * yzViewTrkResVsY
 
TH2D * yzViewTrkResVsZ
 
TH1D * xzViewSubtrkRes
 
TH1D * yzViewSubtrkRes
 
TH2D * xzViewSubtrkResVsX
 
TH2D * xzViewSubtrkResVsZ
 
TH2D * yzViewSubtrkResVsY
 
TH2D * yzViewSubtrkResVsZ
 
TH1D * xzViewRefitRes
 
TH1D * yzViewRefitRes
 
TH2D * xzViewRefitResVsX
 
TH2D * xzViewRefitResVsZ
 
TH2D * yzViewRefitResVsY
 
TH2D * yzViewRefitResVsZ
 
TH1D * trackDCAtoCell
 
TH1D * subTrackDCAtoCell
 
TH1D * refitDCAtoCell
 
TH2D * subtrkXYstart
 
TH2D * subtrkXZstart
 
TH2D * subtrkYZstart
 

Detailed Description

Definition at line 43 of file SplitTracks_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

align::SplitTracks::SplitTracks ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 122 of file SplitTracks_module.cc.

References fTrackAlgEnum, fTrkAlg, and fhicl::ParameterSet::get().

123  : EDAnalyzer(pset)
124  , fTrackInLabel(pset.get<std::string>("TrackInLabel"))
125  , fMinBlocksInTrack(pset.get<int>("MinBlocksInTrack"))
126  , fMinPlanesInSubCluster(pset.get<unsigned int>("MinPlanesInSubCluster"))
127  , fTrkAlg(0)
128  , fTrackAlgEnum(pset.get< int >("TrackingAlgEnumeration", 0))
129 {
130 
131  switch(fTrackAlgEnum){
132  case 0:
133  fTrkAlg = new trk::CosmicTrackAlg(pset.get<fhicl::ParameterSet>("TrackAlgPSet"));
134  break;
135  case 1:
136  fTrkAlg = new trk::WindowTrackingAlg(pset.get<fhicl::ParameterSet>("TrackAlgPSet"));
137  break;
138  default:
139  fTrkAlg = new trk::CosmicTrackAlg(pset.get<fhicl::ParameterSet>("TrackAlgPSet"));
140  break;
141  }
142 }
trk::TrackAlg * fTrkAlg
An algorithm to perform cosmic ray track fitting.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
An algorithm to perform cosmic ray track fitting.
unsigned int fMinPlanesInSubCluster
enum BeamMode string
align::SplitTracks::~SplitTracks ( )
virtual

Definition at line 145 of file SplitTracks_module.cc.

References fTrkAlg.

146 {
147  if (fTrkAlg) delete fTrkAlg;
148 }
trk::TrackAlg * fTrkAlg

Member Function Documentation

void align::SplitTracks::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 241 of file SplitTracks_module.cc.

References elec2geo::block, getBrightness::cell, rb::CellHit::Cell(), rb::Cluster::Cell(), cellPos(), ClearVectors(), geo::ClosestApproach(), daqchannelmap::DAQChannelMap::computeBlock(), om::cout, DemingRegFit(), geo::GeometryBase::DetId(), runNovaSAM::detId, daqchannelmap::DAQChannelMap::encodeLChan(), allTimeWatchdog::endl, rb::Cluster::ExtentPlane(), fMinBlocksInTrack, fMinPlanesInSubCluster, fOutTree, fTrackInLabel, fTrkAlg, art::DataViewImpl::getByLabel(), GetCellEndpoints(), MECModelEnuComparisons::i, rb::Cluster::ID(), rb::Track::InterpolateXY(), rb::Prong::Is3D(), geo::kX, geo::kY, trk::TrackAlg::MakeTrack(), cmap::dataprov::CMap::Map(), rb::Cluster::MaxCell(), rb::Cluster::MaxPlane(), rb::Cluster::MinCell(), rb::Cluster::MinPlane(), rb::Cluster::NCell(), rb::Cluster::NXCell(), rb::Cluster::NYCell(), rb::CellHit::Plane(), elec2geo::pos, refitDCAtoCell, std::sqrt(), rb::Prong::Start(), rb::Track::Stop(), subTrackDCAtoCell, subtrk_Block, subtrk_ErrStartX, subtrk_ErrStartY, subtrk_ErrStartZ, subtrk_ErrStopX, subtrk_ErrStopY, subtrk_ErrStopZ, subtrk_StartX, subtrk_StartY, subtrk_StartZ, subtrk_StopX, subtrk_StopY, subtrk_StopZ, subtrkXYstart, subtrkXZstart, subtrkYZstart, std::swap(), trackDCAtoCell, trk_ID, trk_StartX, trk_StartY, trk_StartZ, trk_StopX, trk_StopY, trk_StopZ, rb::CellHit::View(), rb::Cluster::XCell(), xzViewRefitRes, xzViewRefitResVsX, xzViewRefitResVsZ, xzViewSubtrkRes, xzViewSubtrkResVsX, xzViewSubtrkResVsZ, xzViewTrkRes, xzViewTrkResVsX, xzViewTrkResVsZ, rb::Cluster::YCell(), yzViewRefitRes, yzViewRefitResVsY, yzViewRefitResVsZ, yzViewSubtrkRes, yzViewSubtrkResVsY, yzViewSubtrkResVsZ, yzViewTrkRes, yzViewTrkResVsY, and yzViewTrkResVsZ.

243 {
245  const int detId = geoSvc->DetId(); // What detector am I in?
247 
248  // Get the tracks that were made by CosmicTrack
249  // and split along alignment boundaries
250  /* (blocks for now) */
252  evt.getByLabel(fTrackInLabel,CosmicTracks);
253  if ( CosmicTracks->empty() ) {
254  std::cout << "No tracks found in " << fTrackInLabel << " for this event!" << std::endl;
255  return;
256  }
257 
258  // Loop through CosmicTracks
259  std::unique_ptr< std::vector<rb::Track> > subTrackColl(new std::vector<rb::Track>);
260  for ( size_t trkItr = 0; trkItr < CosmicTracks->size(); ++trkItr ) {
261  art::Ptr<rb::Track> trackIn(CosmicTracks,trkItr);
262 
263  if ( !trackIn->Is3D() ) continue;
264  this->ClearVectors();
265 
266  /* Track Requirements:
267  * Crosses a plane boundary
268  * Contains at least 3 hits in XZ and YZ in each plane
269  */
270 
271  // Crosses a plane boundary?
272  daqchannelmap::lchan logchan = cmapSvc->Map()->encodeLChan(detId, trackIn->MaxPlane(), 1);
273  daqchannelmap::lchan logchan1 = cmapSvc->Map()->encodeLChan(detId, trackIn->MinPlane(), 1);
274  int maxBlock = cmapSvc->Map()->computeBlock(logchan);
275  int minBlock = cmapSvc->Map()->computeBlock(logchan1);
276  if ( maxBlock < minBlock ) {
277  std::cout << "MaxBlock is smaller than MinBlock for this track!" << std::endl;
278  std::swap(maxBlock,minBlock);
279  // This shouldn't happen, so throw a warning if it does...
280  }
281  if ( (maxBlock - minBlock + 1) < fMinBlocksInTrack ) continue;
282 
283  // Does the track go through the top and bottom of the detector bigbox?
284  /*
285  double start[3] = { trackIn->Start().X(), trackIn->Start().Y(), trackIn->Start().Z() };
286  double dir[3] = { trackIn->Dir().X(), trackIn->Dir().Y(), trackIn->Dir().Z() };
287  double boxMin[3];
288  double boxMax[3];
289  geoSvc->DetectorBigBox(&boxMin[0],&boxMax[0],&boxMin[1],&boxMax[1],&boxMin[2],&boxMax[2]);
290  bool thruTop = geo::IntersectsBox( start, dir, boxMin[0], boxMax[0], boxMax[1], boxMax[1], boxMin[2], boxMax[2] );
291  bool thruBot = geo::IntersectsBox( start, dir, boxMin[0], boxMax[0], boxMin[1], boxMin[1], boxMin[2], boxMax[2] );
292  */
293  //std::cout << "Min: " << trackIn->MinCell( geo::kY ) << " Max: " << trackIn->MaxCell( geo::kY ) << std::endl;
294  bool thruTop = ( trackIn->MaxCell( geo::kY ) == 32*12-1 );
295  bool thruBot = ( trackIn->MinCell( geo::kY ) == 0 );
296  if (!(thruTop&&thruBot) ) continue;
297 
298  // Record the parameters for this track
299  trk_ID = trackIn->ID();
300  trk_StartX = trackIn->Start().X();
301  trk_StartY = trackIn->Start().Y();
302  trk_StartZ = trackIn->Start().Z();
303  trk_StopX = trackIn->Stop().X();
304  trk_StopY = trackIn->Stop().Y();
305  trk_StopZ = trackIn->Stop().Z();
306 
307  // Group CellHits into new clusters by block
308  std::vector<rb::Cluster> subClusters( maxBlock-minBlock+1, rb::Cluster() );
309  // Loop through hits in track and sort into subClusters by block
310  for ( size_t cellItr = 0; cellItr < trackIn->NCell(); ++cellItr ) {
311  const art::Ptr<rb::CellHit>& cell = trackIn->Cell(cellItr);
312  daqchannelmap::lchan logchan2 = cmapSvc->Map()->encodeLChan(detId, cell->Plane(),1);
313  int block = cmapSvc->Map()->computeBlock(logchan2);
314  subClusters.at(block-minBlock).Add(cell); // WEIGHTS???
315  /*
316  double W = trackIn->W(cell.get());
317  double cellPos[3];
318  geoSvc->Plane(cell->Plane())->Cell(cell->Cell())->GetCenter(cellPos,W);
319  */
320  double cellLo[3], cellHi[3];
321  this->GetCellEndpoints( cell, cellLo, cellHi );
322  double dOnTrack, dInCell;
323  TVector3 pcaOnTrack, pcaInCell;
324  double dca = geo::ClosestApproach( trackIn->Start(), trackIn->Stop(), TVector3(cellLo), TVector3(cellHi), &dOnTrack, &dInCell, &pcaOnTrack, &pcaInCell );
325  trackDCAtoCell->Fill(dca);
326  double cellPos[3] = { pcaInCell.X(), pcaInCell.Y(), pcaInCell.Z() };
327  double trkX(0), trkY(0);
328  trackIn->InterpolateXY(cellPos[2],trkX,trkY);
329  if ( cell->View() == geo::kX ) {
330  double res = trkX-cellPos[0];
331  xzViewTrkRes->Fill(res);
332  xzViewTrkResVsX->Fill(cell->Cell(),res);
333  xzViewTrkResVsZ->Fill(cell->Plane(),res);
334  }
335  if ( cell->View() == geo::kY ) {
336  double res = trkY-cellPos[1];
337  yzViewTrkRes->Fill(res);
338  yzViewTrkResVsY->Fill(cell->Cell(),res);
339  yzViewTrkResVsZ->Fill(cell->Plane(),res);
340  }
341  }
342 
343  /*
344  // Report!
345  std::cout << "Hey! This track had " << trackIn->NCell() << " cell hits." << std::endl;
346  std::cout << " They were distributed across " << subClusters.size() << " blocks, with" << std::endl;
347  for ( size_t i = 0; i < subClusters.size(); ++i ) {
348  std::cout << " " << subClusters[i].NCell() << " in block " << i << std::endl;
349  }
350  */
351 
352  // Loop through our subClusters and fit them to get end-points and errors
353  for ( size_t clusItr = 0; clusItr < subClusters.size(); ++clusItr ) {
354 
355  // Make a track so we can refine its hit positions with the extrapolated W positions
356  std::vector<rb::Track> subTracks = fTrkAlg->MakeTrack(&subClusters.at(clusItr));
357 
358  // only use subtracks if the vector is of size 1
359  if(subTracks.size() < 1 || subTracks.size() > 1) continue;
360 
361  rb::Track subTrack = subTracks.front();
362 
363  // Does this cluster contain enough Planes?
364  unsigned int nPlanes = subTrack.ExtentPlane();
365  if ( nPlanes < fMinPlanesInSubCluster ) continue;
366  if ( subTrack.NXCell() < 2 ) continue;
367  if ( subTrack.NYCell() < 2 ) continue;
368  subTrackColl->push_back(subTrack);
369 
370  // Refit the two views to get the uncertainties
371  std::vector<double> xzViewX, xzViewZ, yzViewY, yzViewZ, xzViewW, yzViewW;
372  double zMin = 10000000;
373  double zMax = 0.;
374  for ( size_t i = 0; i < subTrack.NCell(); ++i ) {
375  art::Ptr<rb::CellHit> cellHit = subTrack.Cell(i);
376  /*
377  double W = subTrack.W(cellHit.get());
378  double pos[3];
379  geoSvc->Plane(cellHit->Plane())->Cell(cellHit->Cell())->GetCenter(pos,W);
380  */
381  double cellLo[3], cellHi[3];
382  this->GetCellEndpoints( cellHit, cellLo, cellHi );
383  double dOnTrack, dInCell;
384  TVector3 pcaOnTrack, pcaInCell;
385  double dca = geo::ClosestApproach( subTrack.Start(), subTrack.Stop(), TVector3(cellLo), TVector3(cellHi), &dOnTrack, &dInCell, &pcaOnTrack, &pcaInCell );
386  subTrackDCAtoCell->Fill(dca);
387  double pos[3] = { pcaInCell.X(), pcaInCell.Y(), pcaInCell.Z() };
388  //double localXCheck[3]; geoSvc->Plane(cellHit->Plane())->Cell(cellHit->Cell())->WorldToLocal(pos,localXCheck);
389  //std::cout << localXCheck[0] << " " << localXCheck[1] << " " << localXCheck[2] << std::endl;
390  double subtrkX(0), subtrkY(0);
391  subTrack.InterpolateXY(pos[2],subtrkX,subtrkY);
392  if ( cellHit->View() == geo::kX ) {
393  double res = subtrkX-pos[0];
394  xzViewSubtrkRes->Fill(res);
395  xzViewSubtrkResVsX->Fill(cellHit->Cell(),res);
396  xzViewSubtrkResVsZ->Fill(cellHit->Plane(),res);
397  xzViewX.push_back(pos[0]);
398  xzViewZ.push_back(pos[2]);
399  xzViewW.push_back(1.);
400  }
401  if ( cellHit->View() == geo::kY ) {
402  double res = subtrkY-pos[1];
403  yzViewSubtrkRes->Fill(res);
404  yzViewSubtrkResVsY->Fill(cellHit->Cell(),res);
405  yzViewSubtrkResVsZ->Fill(cellHit->Plane(),res);
406  yzViewY.push_back(pos[1]);
407  yzViewZ.push_back(pos[2]);
408  yzViewW.push_back(1.);
409  }
410  if ( pos[2] < zMin ) zMin = pos[2];
411  if ( pos[2] > zMax ) zMax = pos[2];
412  }
413 
414  // Fits
415  double sigX = 3./sqrt(12);
416  double sigY = 3./sqrt(12);
417  double sigZ = 5./sqrt(12);
418  double xStart, yStart, zStart;
419  double xStartErr, yStartErr, zStartErr;
420  double xStop, yStop, zStop;
421  double xStopErr, yStopErr, zStopErr;
422  zStart = zMin; zStartErr = 0.;//sigZ;
423  zStop = zMax; zStopErr = 0.;//sigZ;
424  this->DemingRegFit( xzViewZ, xzViewX, xzViewW, sigZ, sigX, zStart, xStart, zStop, xStop, xStartErr, xStopErr );
425  this->DemingRegFit( yzViewZ, yzViewY, yzViewW, sigZ, sigY, zStart, yStart, zStop, yStop, yStartErr, yStopErr );
426 
427  // Residuals from refits
428  for ( size_t i = 0; i < subTrack.NXCell(); ++i ) {
429  art::Ptr<rb::CellHit> cellHit = subTrack.XCell(i);
430  /*
431  double W = subTrack.W(cellHit.get());
432  double pos[3];
433  geoSvc->Plane(cellHit->Plane())->Cell(cellHit->Cell())->GetCenter(pos,W);
434  */
435  double cellLo[3], cellHi[3];
436  this->GetCellEndpoints( cellHit, cellLo, cellHi );
437  double dOnTrack, dInCell;
438  TVector3 pcaOnTrack, pcaInCell;
439  double dca = geo::ClosestApproach( TVector3(xStart,yStart,zStart), TVector3(xStop,yStop,zStop), TVector3(cellLo), TVector3(cellHi), &dOnTrack, &dInCell, &pcaOnTrack, &pcaInCell );
440  refitDCAtoCell->Fill(dca);
441  double pos[3] = { pcaInCell.X(), pcaInCell.Y(), pcaInCell.Z() };
442  double slopeX = (xStop-xStart)/(zStop-zStart);
443  double extrapX = slopeX*(pos[2]-zStart)+xStart;
444  double res = extrapX-pos[0];
445  xzViewRefitRes->Fill(res);
446  xzViewRefitResVsX->Fill(cellHit->Cell(),res);
447  xzViewRefitResVsZ->Fill(cellHit->Plane(),res);
448  }
449  for ( size_t i = 0; i < subTrack.NYCell(); ++i ) {
450  art::Ptr<rb::CellHit> cellHit = subTrack.YCell(i);
451  /*
452  double W = subTrack.W(cellHit.get());
453  double pos[3];
454  geoSvc->Plane(cellHit->Plane())->Cell(cellHit->Cell())->GetCenter(pos,W);
455  */
456  double cellLo[3], cellHi[3];
457  this->GetCellEndpoints( cellHit, cellLo, cellHi );
458  double dOnTrack, dInCell;
459  TVector3 pcaOnTrack, pcaInCell;
460  double dca = geo::ClosestApproach( TVector3(xStart,yStart,zStart), TVector3(xStop,yStop,zStop), TVector3(cellLo), TVector3(cellHi), &dOnTrack, &dInCell, &pcaOnTrack, &pcaInCell );
461  refitDCAtoCell->Fill(dca);
462  double pos[3] = { pcaInCell.X(), pcaInCell.Y(), pcaInCell.Z() };
463  double slopeY = (yStop-yStart)/(zStop-zStart);
464  double extrapY = slopeY*(pos[2]-zStart)+yStart;
465  double res = extrapY-pos[1];
466  yzViewRefitRes->Fill(res);
467  yzViewRefitResVsY->Fill(cellHit->Cell(),res);
468  yzViewRefitResVsZ->Fill(cellHit->Plane(),res);
469  }
470  subtrkXYstart->Fill(xStart,yStart);
471  subtrkXZstart->Fill(zStart,xStart);
472  subtrkYZstart->Fill(zStart,yStart);
473 
474  //if ( xStartErr > 1000 || xStopErr > 1000 ) continue;
475 
476  // Record the parameters for this subtrack
477  daqchannelmap::lchan logchan3 = cmapSvc->Map()->encodeLChan(detId, subTrack.MinPlane(),1);
478  subtrk_Block.push_back( cmapSvc->Map()->computeBlock(logchan3));
479  subtrk_StartX.push_back( xStart );
480  subtrk_StartY.push_back( yStart );
481  subtrk_StartZ.push_back( zStart );
482  subtrk_ErrStartX.push_back( xStartErr );
483  subtrk_ErrStartY.push_back( yStartErr );
484  subtrk_ErrStartZ.push_back( zStartErr );
485  subtrk_StopX.push_back( xStop );
486  subtrk_StopY.push_back( yStop );
487  subtrk_StopZ.push_back( zStop );
488  subtrk_ErrStopX.push_back( xStopErr );
489  subtrk_ErrStopY.push_back( yStopErr );
490  subtrk_ErrStopZ.push_back( zStopErr );
491 
492  }
493 
494  //std::cout << "This track had " << TracksOut.size() << " subtracks." << std::endl;
495 
496  // Save properties of this track and each of its subtracks to ROOT TTree
497  fOutTree->Fill();
498 
499  } // End loop through CosmicTracks
500  //evt.put(std::move(subTrackColl));
501 
502  return;
503 }
std::vector< double > subtrk_ErrStopY
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
std::vector< double > subtrk_StartZ
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
unsigned short Plane() const
Definition: CellHit.h:39
std::vector< double > subtrk_ErrStartZ
geo::View_t View() const
Definition: CellHit.h:41
double DemingRegFit(const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w, double &sigXY, double &sigZ, double &x1, double &y1, double &x2, double &y2, double &sigy1, double &sigy2)
Find the best-fit line to a collection of points in 2-D using Deming regression.
T sqrt(T number)
Definition: d0nt_math.hpp:156
Vertical planes which measure X.
Definition: PlaneGeo.h:28
std::vector< double > subtrk_ErrStopZ
A collection of associated CellHits.
Definition: Cluster.h:47
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
trk::TrackAlg * fTrkAlg
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
virtual TVector3 Start() const
Definition: Prong.h:73
lchan encodeLChan(int detId, plane_t plane, cell_t cell) const
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
unsigned short Cell() const
Definition: CellHit.h:40
block
print "ROW IS " print row
Definition: elec2geo.py:31
std::vector< double > subtrk_ErrStartX
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
Definition: Cluster.cxx:165
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
int evt
std::vector< int > subtrk_Block
std::vector< double > subtrk_StopX
void cellPos()
Definition: cellShifts.C:26
std::vector< double > subtrk_StopY
OStream cout
Definition: OStream.cxx:6
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.cxx:462
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
std::vector< double > subtrk_ErrStartY
double ClosestApproach(const double point[], const double intercept[], const double slopes[], double closest[])
Find the distance of closest approach between point and line.
Definition: Geo.cxx:222
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
std::vector< double > subtrk_StartY
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.h:250
std::vector< double > subtrk_StopZ
std::vector< double > subtrk_ErrStopX
virtual void InterpolateXY(double z, double &x, double &y) const
Definition: Track.cxx:325
virtual std::vector< rb::Track > MakeTrack(const rb::Cluster *slice)=0
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
virtual block_t computeBlock(lchan logicalchan) const =0
Which block is this lchan in?
unsigned int fMinPlanesInSubCluster
std::vector< double > subtrk_StartX
void GetCellEndpoints(art::Ptr< rb::CellHit > cell, double *cellLo, double *cellHi)
void align::SplitTracks::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 151 of file SplitTracks_module.cc.

References blockCenterX, blockCenterY, blockCenterZ, fGeoTree, fOutTree, art::TFileDirectory::make(), refitDCAtoCell, subTrackDCAtoCell, subtrk_Block, subtrk_ErrStartX, subtrk_ErrStartY, subtrk_ErrStartZ, subtrk_ErrStopX, subtrk_ErrStopY, subtrk_ErrStopZ, subtrk_StartX, subtrk_StartY, subtrk_StartZ, subtrk_StopX, subtrk_StopY, subtrk_StopZ, subtrkXYstart, subtrkXZstart, subtrkYZstart, trackDCAtoCell, trk_ID, trk_StartX, trk_StartY, trk_StartZ, trk_StopX, trk_StopY, trk_StopZ, xzViewRefitRes, xzViewRefitResVsX, xzViewRefitResVsZ, xzViewSubtrkRes, xzViewSubtrkResVsX, xzViewSubtrkResVsZ, xzViewTrkRes, xzViewTrkResVsX, xzViewTrkResVsZ, yzViewRefitRes, yzViewRefitResVsY, yzViewRefitResVsZ, yzViewSubtrkRes, yzViewSubtrkResVsY, yzViewSubtrkResVsZ, yzViewTrkRes, yzViewTrkResVsY, and yzViewTrkResVsZ.

151  {
153 
154  // Output TTree
155  fGeoTree = tfs->make<TTree>("GeometryInfo","Geometry Info");
156  fOutTree = tfs->make<TTree>("SplitTracks","Split Tracks");
157 
158  // Geometry details
159  fGeoTree->Branch("blockCenterX", &blockCenterX);
160  fGeoTree->Branch("blockCenterY", &blockCenterY);
161  fGeoTree->Branch("blockCenterZ", &blockCenterZ);
162  // Get Geo details...
163  fGeoTree->Fill();
164 
165  // Track details
166  fOutTree->Branch("trk_ID", &trk_ID);
167  fOutTree->Branch("trk_StartX", &trk_StartX);
168  fOutTree->Branch("trk_StartY", &trk_StartY);
169  fOutTree->Branch("trk_StartZ", &trk_StartZ);
170  fOutTree->Branch("trk_StopX", &trk_StopX);
171  fOutTree->Branch("trk_StopY", &trk_StopY);
172  fOutTree->Branch("trk_StopZ", &trk_StopZ);
173 
174  fOutTree->Branch("subtrk_Block", &subtrk_Block);
175  fOutTree->Branch("subtrk_StartX", &subtrk_StartX);
176  fOutTree->Branch("subtrk_StartY", &subtrk_StartY);
177  fOutTree->Branch("subtrk_StartZ", &subtrk_StartZ);
178  fOutTree->Branch("subtrk_ErrStartX", &subtrk_ErrStartX);
179  fOutTree->Branch("subtrk_ErrStartY", &subtrk_ErrStartY);
180  fOutTree->Branch("subtrk_ErrStartZ", &subtrk_ErrStartZ);
181  fOutTree->Branch("subtrk_StopX", &subtrk_StopX);
182  fOutTree->Branch("subtrk_StopY", &subtrk_StopY);
183  fOutTree->Branch("subtrk_StopZ", &subtrk_StopZ);
184  fOutTree->Branch("subtrk_ErrStopX", &subtrk_ErrStopX);
185  fOutTree->Branch("subtrk_ErrStopY", &subtrk_ErrStopY);
186  fOutTree->Branch("subtrk_ErrStopZ", &subtrk_ErrStopZ);
187 
188  subtrkXYstart = tfs->make<TH2D>("subtrkXYstart","Downstream Subtrack Start (XY);X-view Cell;Y-view Cell",100,-775,775,100,-775,775);
189  subtrkXZstart = tfs->make<TH2D>("subtrkXZstart","Downstream Subtrack Start (XZ);Plane;X-view Cell",600,0,6000,1550,-775,775);
190  subtrkYZstart = tfs->make<TH2D>("subtrkYZstart","Downstream Subtrack Start (YZ);Plane;Y-view Cell",600,0,6000,1550,-775,775);
191 
192  xzViewTrkRes = tfs->make<TH1D>("xzViewTrkRes","Track Residual (X-View);Residual",100,-10,10);
193  yzViewTrkRes = tfs->make<TH1D>("yzViewTrkRes","Track Residual (Y-View);Residual",100,-10,10);
194  xzViewTrkResVsX = tfs->make<TH2D>("xzViewTrkResVsX","Track Residual (X-View) vs Cell Position (X);Cell Number;Residual",32*12,0,32*12,100,-10,10);
195  xzViewTrkResVsZ = tfs->make<TH2D>("xzViewTrkResVsZ","Track Residual (X-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
196  yzViewTrkResVsY = tfs->make<TH2D>("yzViewTrkResVsY","Track Residual (Y-View) vs Cell Position (Y);Cell Number;Residual",32*12,0,32*12,100,-10,10);
197  yzViewTrkResVsZ = tfs->make<TH2D>("yzViewTrkResVsZ","Track Residual (Y-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
198 
199  xzViewSubtrkRes = tfs->make<TH1D>("xzViewSubtrkRes","SubTrack Residual (X-View);Residual",100,-10,10);
200  yzViewSubtrkRes = tfs->make<TH1D>("yzViewSubtrkRes","SubTrack Residual (Y-View);Residual",100,-10,10);
201  xzViewSubtrkResVsX = tfs->make<TH2D>("xzViewSubtrkResVsX","SubTrack Residual (X-View) vs Cell Position (X);Cell Number;Residual",32*12,0,32*12,100,-10,10);
202  xzViewSubtrkResVsZ = tfs->make<TH2D>("xzViewSubtrkResVsZ","SubTrack Residual (X-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
203  yzViewSubtrkResVsY = tfs->make<TH2D>("yzViewSubtrkResVsY","SubTrack Residual (Y-View) vs Cell Position (Y);Cell Number;Residual",32*12,0,32*12,100,-10,10);
204  yzViewSubtrkResVsZ = tfs->make<TH2D>("yzViewSubtrkResVsZ","SubTrack Residual (Y-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
205 
206  xzViewRefitRes = tfs->make<TH1D>("xzViewRefitRes","Refitted SubTrack Residual (X-View);Residual",100,-10,10);
207  yzViewRefitRes = tfs->make<TH1D>("yzViewRefitRes","Refitted SubTrack Residual (Y-View);Residual",100,-10,10);
208  xzViewRefitResVsX = tfs->make<TH2D>("xzViewRefitResVsX","Refitted SubTrack Residual (X-View) vs Cell Position (X);Cell Number;Residual",32*12,0,32*12,100,-10,10);
209  xzViewRefitResVsZ = tfs->make<TH2D>("xzViewRefitResVsZ","Refitted SubTrack Residual (X-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
210  yzViewRefitResVsY = tfs->make<TH2D>("yzViewRefitResVsY","Refitted SubTrack Residual (Y-View) vs Cell Position (Y);Cell Number;Residual",32*12,0,32*12,100,-10,10);
211  yzViewRefitResVsZ = tfs->make<TH2D>("yzViewRefitResVsZ","Refitted SubTrack Residual (Y-View) vs Cell Position (Z);Plane Number;Residual",32*28,0,32*28,100,-10,10);
212 
213  trackDCAtoCell = tfs->make<TH1D>("trackDCAtoCell","Track DCA to Cell",100,0,10);
214  subTrackDCAtoCell = tfs->make<TH1D>("subTrackDCAtoCell","SubTrack DCA to Cell",100,0,10);
215  refitDCAtoCell = tfs->make<TH1D>("refitDCAtoCell","Refitted SubTrack DCA to Cell",100,0,10);
216 
217  return;
218 }
std::vector< double > subtrk_ErrStopY
std::vector< double > subtrk_StartZ
std::vector< double > subtrk_ErrStartZ
std::vector< double > blockCenterX
std::vector< double > subtrk_ErrStopZ
std::vector< double > subtrk_ErrStartX
std::vector< int > subtrk_Block
std::vector< double > subtrk_StopX
std::vector< double > subtrk_StopY
std::vector< double > subtrk_ErrStartY
T * make(ARGS...args) const
std::vector< double > blockCenterZ
std::vector< double > subtrk_StartY
std::vector< double > subtrk_StopZ
std::vector< double > subtrk_ErrStopX
std::vector< double > blockCenterY
std::vector< double > subtrk_StartX
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
void align::SplitTracks::ClearVectors ( )

Definition at line 220 of file SplitTracks_module.cc.

References subtrk_Block, subtrk_ErrStartX, subtrk_ErrStartY, subtrk_ErrStartZ, subtrk_ErrStopX, subtrk_ErrStopY, subtrk_ErrStopZ, subtrk_StartX, subtrk_StartY, subtrk_StartZ, subtrk_StopX, subtrk_StopY, subtrk_StopZ, trk_ID, trk_StartX, trk_StartY, trk_StartZ, trk_StopX, trk_StopY, and trk_StopZ.

Referenced by analyze().

220  {
221  trk_ID = 0;
222  trk_StartX = 0; trk_StartY = 0; trk_StartZ = 0;
223  trk_StopX = 0; trk_StopY = 0; trk_StopZ = 0;
224  subtrk_Block.clear();
225  subtrk_StartX.clear();
226  subtrk_StartY.clear();
227  subtrk_StartZ.clear();
228  subtrk_ErrStartX.clear();
229  subtrk_ErrStartY.clear();
230  subtrk_ErrStartZ.clear();
231  subtrk_StopX.clear();
232  subtrk_StopY.clear();
233  subtrk_StopZ.clear();
234  subtrk_ErrStopX.clear();
235  subtrk_ErrStopY.clear();
236  subtrk_ErrStopZ.clear();
237  return;
238 }
std::vector< double > subtrk_ErrStopY
std::vector< double > subtrk_StartZ
std::vector< double > subtrk_ErrStartZ
std::vector< double > subtrk_ErrStopZ
std::vector< double > subtrk_ErrStartX
std::vector< int > subtrk_Block
std::vector< double > subtrk_StopX
std::vector< double > subtrk_StopY
std::vector< double > subtrk_ErrStartY
std::vector< double > subtrk_StartY
std::vector< double > subtrk_StopZ
std::vector< double > subtrk_ErrStopX
std::vector< double > subtrk_StartX
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
double align::SplitTracks::DemingRegFit ( const std::vector< double > &  x,
const std::vector< double > &  y,
const std::vector< double > &  w,
double &  sigX,
double &  sigY,
double &  x1,
double &  y1,
double &  x2,
double &  y2,
double &  sigy1,
double &  sigy2 
)

Find the best-fit line to a collection of points in 2-D using Deming regression.

This is similar to LinFitMinDPerp, but uses errors on hits http://en.wikipedia.org/wiki/Deming_regression

Parameters
x- input vector of x coordinates
y- input vector of y coordinates
w- input vector of weights for the points
sigX- uncertainty on cell hit position along x-axis
sigY- uncertainty on cell hit position along y-axis
x1- position of one end of segment (given)
x2- position of other end of segment (given)
y1- coordinate of line extrapolated to x1
y2- coordinate of line extrapolated to x2
sigy1- uncertainty on extrapolated coordinate y1
sigy2- uncertainty on extrapolated coordinate y2
Returns
The chi^2 value defined by chi^2 = sum_i[w_i d^2_i]

Definition at line 526 of file SplitTracks_module.cc.

References ana::assert(), chi2(), delta, MECModelEnuComparisons::i, and std::sqrt().

Referenced by analyze().

533 {
534  double delta = sigY / sigX;
535 
536  // Before going ahead, make sure we have sensible arrays
537  assert(x.size()==y.size());
538  assert(x.size()==w.size());
539  assert(x.size()>=2);
540  unsigned int i;
541 
542  // Accumulate the sums needed to compute the fit line
543  double xAve = 0.0;
544  double yAve = 0.0;
545  int nHit = 0;
546  for (i=0; i<w.size(); ++i) {
547  if (w[i] == 0) continue;
548  nHit++;
549  xAve += x[i];
550  yAve += y[i];
551  }
552  xAve /= double(nHit);
553  yAve /= double(nHit);
554  double Sxy = 0.0;
555  double Syy = 0.0;
556  double Sxx = 0.0;
557  for (i=0; i<w.size(); ++i) {
558  if (w[i] == 0) continue;
559  Sxx += (x[i] - xAve)*(x[i] - xAve);
560  Syy += (y[i] - yAve)*(y[i] - yAve);
561  Sxy += (x[i] - xAve)*(y[i] - yAve);
562  }
563  Sxx /= double(nHit-1);
564  Syy /= double(nHit-1);
565  Sxy /= double(nHit-1);
566 
567  // The best fit through the points
568  double M1;
569  //double B1;
570  double xydiff = Syy - delta*Sxx;
571  double radic = sqrt( (xydiff*xydiff) + 4*delta*Sxy*Sxy );
572  double numer = xydiff + radic;
573  double denom = 2.*Sxy;
574  M1 = ( numer ) / ( denom );
575  //B1 = yAve - M1*xAve;
576 
577  y1 = M1*(x1-xAve) + yAve;
578  y2 = M1*(x2-xAve) + yAve;
579 
580  // Compute errors
581  double sig2y1(0), sig2y2(0);
582  for (i=0; i<w.size(); ++i) {
583  if (w[i] == 0) continue;
584  double dnumdx = 0.;
585  double dnumdy = 0.;
586  dnumdx += delta*(2/double(nHit-1))*(x[i]-xAve);
587  dnumdx += 1./(2*radic)*( 2*xydiff*( -delta*2/double(nHit-1)*(x[i]-xAve) )
588  + 8*delta*Sxy*1./double(nHit-1)*(y[i]-yAve) );
589  dnumdy += (2/double(nHit-1))*(y[i]-yAve);
590  dnumdx += 1./(2*radic)*( 2*xydiff*( 2/double(nHit-1)*(y[i]-yAve) )
591  + 8*Sxy*1./double(nHit-1)*(x[i]-xAve) );
592  double dM1dx = denom != 0. ? ( dnumdx - M1*2/double(nHit-1)*(y[i]-yAve) ) / ( denom ) : 0.;
593  double dM1dy = denom != 0. ? ( dnumdy - M1*2/double(nHit-1)*(x[i]-xAve) ) / ( denom ) : 0.;
594  /*
595  double dB1dx = -( M1/double(nHit) + xAve*dM1dx );
596  double dB1dy = 1/double(nHit) - xAve*dM1dy;
597  double dx1dx = 0;
598  double dx2dx = 0;
599  double dy1dx = dM1dx*x1 + M1*dx1dx + dB1dx;
600  double dy1dy = dM1dy*x1 + dB1dy;
601  double dy2dx = dM1dx*x2 + M1*dx2dx + dB1dx;
602  double dy2dy = dM1dy*x2 + dB1dy;
603  */
604  double dy1dx = dM1dx*(x1-xAve) + M1;
605  double dy1dy = dM1dy*(x1-xAve) + 1./double(nHit);
606  double dy2dx = dM1dx*(x2-xAve) + M1;
607  double dy2dy = dM1dy*(x2-xAve) + 1./double(nHit);
608  sig2y1 += dy1dx*dy1dx*sigX*sigX + dy1dy*dy1dy*sigY*sigY;
609  sig2y2 += dy2dx*dy2dx*sigX*sigX + dy2dy*dy2dy*sigY*sigY;
610  }
611  sigy1 = sqrt(sig2y1);
612  sigy2 = sqrt(sig2y2);
613 
614  //if ( sigy1 > 1000 || sigy2 > 1000 ) {
615  // std::cout << "Anomalous solution! ( " << sigy1 << " " << sigy2 << " )" << std::endl;
616  // for ( i = 0; i < w.size(); ++i ) {
617  // if ( w[i] == 0 ) continue;
618  // std::cout << "(" << y[i] << "," << x[i] << ") ";
619  // }
620  // std::cout << "Endpoints: (" << y1 << "," << x1 << ") (" << y2 << "," << x2 << ")" <<std::endl;
621  // std::cout << "Slope " << M1 << " Intercept " << B1 << std::endl;
622  //}
623 
624  // Compute the chi^2 function for return (Doesn't use errors!)
625  double chi2 = 0.;
626 
627  return chi2;
628 }
Float_t y1[n_points_granero]
Definition: compare.C:5
double delta
Definition: runWimpSim.h:98
Float_t x1[n_points_granero]
Definition: compare.C:5
T sqrt(T number)
Definition: d0nt_math.hpp:156
double chi2()
assert(nhit_max >=nhit_nbins)
Float_t w
Definition: plot.C:20
TVector3 align::SplitTracks::GeoEstimatePos ( art::Ptr< rb::CellHit cellHit,
double  W 
)

Definition at line 630 of file SplitTracks_module.cc.

References getBrightness::cell, rb::CellHit::Cell(), geo::PlaneGeo::Cell(), geo::CellGeo::LocalToWorld(), rb::CellHit::Plane(), geo::GeometryBase::Plane(), and NDAPDHVSetting::plane.

630  {
632  size_t plane = cellHit->Plane();
633  size_t cell = cellHit->Cell();
634  const geo::CellGeo* theCell = geoSvc->Plane(plane)->Cell(cell);
635  double localHitPos[3] = { 0., 0., XY };
636  double worldHitPos[3];
637  theCell->LocalToWorld(localHitPos,worldHitPos);
638  return TVector3(worldHitPos);
639 }
void LocalToWorld(const double *local, double *world) const
Definition: CellGeo.cxx:80
unsigned short Plane() const
Definition: CellHit.h:39
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const PlaneGeo * Plane(unsigned int i) const
unsigned short Cell() const
Definition: CellHit.h:40
Encapsulate the cell geometry.
Definition: CellGeo.h:25
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
void align::SplitTracks::GetCellEndpoints ( art::Ptr< rb::CellHit cell,
double *  cellLo,
double *  cellHi 
)

Definition at line 641 of file SplitTracks_module.cc.

References getBrightness::cell, rb::CellHit::Cell(), geo::PlaneGeo::Cell(), DEFINE_ART_MODULE(), geo::CellGeo::HalfL(), geo::CellGeo::LocalToWorld(), rb::CellHit::Plane(), geo::GeometryBase::Plane(), and NDAPDHVSetting::plane.

Referenced by analyze().

641  {
643  size_t plane = cellHit->Plane();
644  size_t cell = cellHit->Cell();
645  const geo::CellGeo* theCell = geoSvc->Plane(plane)->Cell(cell);
646  double localLo[3] = { 0., 0., -theCell->HalfL() };
647  double localHi[3] = { 0., 0., theCell->HalfL() };
648  theCell->LocalToWorld(localLo,cellLo);
649  theCell->LocalToWorld(localHi,cellHi);
650  return;
651 }
double HalfL() const
Definition: CellGeo.cxx:198
void LocalToWorld(const double *local, double *world) const
Definition: CellGeo.cxx:80
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const PlaneGeo * Plane(unsigned int i) const
unsigned short Cell() const
Definition: CellHit.h:40
Encapsulate the cell geometry.
Definition: CellGeo.h:25
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

std::vector<double> align::SplitTracks::blockCenterX
private

Definition at line 77 of file SplitTracks_module.cc.

Referenced by beginJob().

std::vector<double> align::SplitTracks::blockCenterY
private

Definition at line 78 of file SplitTracks_module.cc.

Referenced by beginJob().

std::vector<double> align::SplitTracks::blockCenterZ
private

Definition at line 79 of file SplitTracks_module.cc.

Referenced by beginJob().

TTree* align::SplitTracks::fGeoTree
private

Definition at line 73 of file SplitTracks_module.cc.

Referenced by beginJob().

int align::SplitTracks::fMinBlocksInTrack
private

Definition at line 68 of file SplitTracks_module.cc.

Referenced by analyze().

unsigned int align::SplitTracks::fMinPlanesInSubCluster
private

Definition at line 69 of file SplitTracks_module.cc.

Referenced by analyze().

TTree* align::SplitTracks::fOutTree
private

Definition at line 74 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

int align::SplitTracks::fTrackAlgEnum
private

Definition at line 72 of file SplitTracks_module.cc.

Referenced by SplitTracks().

std::string align::SplitTracks::fTrackInLabel
private

Definition at line 67 of file SplitTracks_module.cc.

Referenced by analyze().

trk::TrackAlg* align::SplitTracks::fTrkAlg
private

Definition at line 71 of file SplitTracks_module.cc.

Referenced by analyze(), SplitTracks(), and ~SplitTracks().

TH1D* align::SplitTracks::refitDCAtoCell
private

Definition at line 113 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::subTrackDCAtoCell
private

Definition at line 112 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

std::vector<int> align::SplitTracks::subtrk_Block
private

Definition at line 85 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStartX
private

Definition at line 87 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStartY
private

Definition at line 87 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStartZ
private

Definition at line 87 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStopX
private

Definition at line 89 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStopY
private

Definition at line 89 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_ErrStopZ
private

Definition at line 89 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StartX
private

Definition at line 86 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StartY
private

Definition at line 86 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StartZ
private

Definition at line 86 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StopX
private

Definition at line 88 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StopY
private

Definition at line 88 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

std::vector<double> align::SplitTracks::subtrk_StopZ
private

Definition at line 88 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

TH2D* align::SplitTracks::subtrkXYstart
private

Definition at line 115 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::subtrkXZstart
private

Definition at line 116 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::subtrkYZstart
private

Definition at line 117 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::trackDCAtoCell
private

Definition at line 111 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

int align::SplitTracks::trk_ID
private

Definition at line 82 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StartX
private

Definition at line 83 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StartY
private

Definition at line 83 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StartZ
private

Definition at line 83 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StopX
private

Definition at line 84 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StopY
private

Definition at line 84 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

double align::SplitTracks::trk_StopZ
private

Definition at line 84 of file SplitTracks_module.cc.

Referenced by analyze(), beginJob(), and ClearVectors().

TH1D* align::SplitTracks::xzViewRefitRes
private

Definition at line 104 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewRefitResVsX
private

Definition at line 106 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewRefitResVsZ
private

Definition at line 107 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::xzViewSubtrkRes
private

Definition at line 98 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewSubtrkResVsX
private

Definition at line 100 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewSubtrkResVsZ
private

Definition at line 101 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::xzViewTrkRes
private

Definition at line 92 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewTrkResVsX
private

Definition at line 94 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::xzViewTrkResVsZ
private

Definition at line 95 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::yzViewRefitRes
private

Definition at line 105 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewRefitResVsY
private

Definition at line 108 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewRefitResVsZ
private

Definition at line 109 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::yzViewSubtrkRes
private

Definition at line 99 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewSubtrkResVsY
private

Definition at line 102 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewSubtrkResVsZ
private

Definition at line 103 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH1D* align::SplitTracks::yzViewTrkRes
private

Definition at line 93 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewTrkResVsY
private

Definition at line 96 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().

TH2D* align::SplitTracks::yzViewTrkResVsZ
private

Definition at line 97 of file SplitTracks_module.cc.

Referenced by analyze(), and beginJob().


The documentation for this class was generated from the following file: