All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vertex::AggregateVertexAna Class Reference
Inheritance diagram for vertex::AggregateVertexAna:

Public Member Functions

 AggregateVertexAna (fhicl::ParameterSet const &pset)
 
 ~AggregateVertexAna ()
 

Private Member Functions

void analyze (const art::Event &evt)
 
void beginJob ()
 

Private Attributes

TH1F * HnTrksVtx
 
TH1F * HnVtxes
 
TH1F * HVtxSep
 
TH2F * HVtxRZ
 
std::string fDBScanModuleLabel
 
std::string fHoughModuleLabel
 
std::string fHitModuleLabel
 
std::string fTrack3DModuleLabel
 
std::string fEndPointModuleLabel
 
std::string fVertexModuleLabel
 
art::PtrVector< recob::Hitfhitlist
 
art::PtrVector< recob::EndPoint2Dfeplist
 
art::PtrVector< recob::Trackftracklist
 
art::PtrVector< recob::VertexfVertexlist
 

Detailed Description

Definition at line 34 of file AggregateVertexAna_module.cc.

Constructor & Destructor Documentation

vertex::AggregateVertexAna::AggregateVertexAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 71 of file AggregateVertexAna_module.cc.

72  : EDAnalyzer(pset)
73  , fHitModuleLabel (pset.get< std::string >("FFFTHitModuleLabel"))
74  , fTrack3DModuleLabel (pset.get< std::string >("Track3DModuleLabel"))
75  , fEndPointModuleLabel(pset.get< std::string >("EndPointModuleLabel"))
76  , fVertexModuleLabel (pset.get< std::string >("VertexModuleLabel"))
77  {
78 
79 
80  }
vertex::AggregateVertexAna::~AggregateVertexAna ( )

Definition at line 83 of file AggregateVertexAna_module.cc.

84  {
85  }

Member Function Documentation

void vertex::AggregateVertexAna::analyze ( const art::Event &  evt)
private

Definition at line 101 of file AggregateVertexAna_module.cc.

102  {
103  art::Handle< std::vector<recob::Hit> > hitListHandle;
104  evt.getByLabel(fHitModuleLabel,hitListHandle);
105  for(unsigned int ii = 0; ii < hitListHandle->size(); ++ii){
106  art::Ptr<recob::Hit> hit(hitListHandle, ii);
107  fhitlist.push_back(hit); // class member
108  }
109 
110  art::Handle< std::vector<recob::EndPoint2D> > epListHandle;
111  evt.getByLabel(fEndPointModuleLabel,epListHandle);
112  for(unsigned int ii = 0; ii < epListHandle->size(); ++ii){
113  art::Ptr<recob::EndPoint2D> ep(epListHandle, ii);
114  feplist.push_back(ep); // class member
115  }
116 
117  art::Handle< std::vector<recob::Track> > trackListHandle;
118  evt.getByLabel(fTrack3DModuleLabel,trackListHandle);
119  for(unsigned int ii = 0; ii < trackListHandle->size(); ++ii){
120  art::Ptr<recob::Track> track(trackListHandle, ii);
121  ftracklist.push_back(track); // class member
122  }
123 
124  art::Handle< std::vector<recob::Vertex> > vertexListHandle;
125  evt.getByLabel(fVertexModuleLabel,vertexListHandle);
126  for(unsigned int ii = 0; ii < vertexListHandle->size(); ++ii){
127  art::Ptr<recob::Vertex> vertex(vertexListHandle, ii);
128  fVertexlist.push_back(vertex); // class member
129  }
130 
131  HnVtxes->Fill(feplist.size(),1);
132 
133  art::FindManyP<recob::Track> fmt(vertexListHandle, evt, fVertexModuleLabel);
134  art::FindManyP<recob::Hit> fmh(vertexListHandle, evt, fVertexModuleLabel);
135 
136  for(size_t v1 = 0; v1 < fVertexlist.size(); ++v1) {
137 
138  std::vector< art::Ptr<recob::Track> > tvlist = fmt.at(v1);
139 
140  HnTrksVtx->Fill(tvlist.size(),1);
141 
142  if(tvlist.size() < 1) continue;
143 
144  std::vector< art::Ptr<recob::Hit> > hitvlist = fmh.at(v1);
145 
146  // Hits no longer has XYZ() method. To get 3d hit position info I'm going to have to
147  // loop on all the SpacePoints and loop on all Hits from there till it matches
148  // one from this vertex. This affects the two Fill() efforts below. EC, 19-Nov-2010.
149  art::PtrVector<recob::Hit>::const_iterator hitv = hitvlist.begin();
150 
151  for(size_t v2 = v1+1; v2 < fVertexlist.size(); ++v2){
152 
153  std::vector< art::Ptr<recob::Hit> > hitvlist2 = fmh.at(v2);
154 
155  std::vector< art::Ptr<recob::Hit> >::const_iterator hitv2 = hitvlist2.begin();
156 
157  // These two whiles should be each precisely one iteration long.
158  while( hitv != hitvlist.end() ){
159  while( hitv2 != hitvlist2.end() ){
160  TVector3 dist;
161  mf::LogInfo("AggregateVertexAna") << "AggregateVertexAna: dist is " << dist.Mag() << ".";
162  HVtxSep->Fill(dist.Mag(),1);
163  hitv2++;
164  }
165  hitv++;
166  }// end loop over hitv entries
167 
168  }// end loop over v2
169  }// end loop over v1
170 
171  return;
172  }// end analyze
process_name vertex
Definition: cheaterreco.fcl:51
art::PtrVector< recob::Track > ftracklist
process_name use argoneut_mc_hitfinder track
process_name hit
Definition: cheaterreco.fcl:51
art::PtrVector< recob::Hit > fhitlist
art::PtrVector< recob::EndPoint2D > feplist
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
art::PtrVector< recob::Vertex > fVertexlist
TCEvent evt
Definition: DataStructs.cxx:8
void vertex::AggregateVertexAna::beginJob ( )
private

Definition at line 88 of file AggregateVertexAna_module.cc.

89  {
90  art::ServiceHandle<art::TFileService const> tfs;
91 
92  HnVtxes = tfs->make<TH1F>("Num Vertices","Num Vertices",8,-0.5,7.5);
93  HVtxSep = tfs->make<TH1F>("Vertices spacing","Vertices spacing",20,0.001,5.0);
94  HVtxRZ = tfs->make<TH2F>("Vtx in RZ","Vtx in RZ",20,-50.0,+50.0,20,0.0,50.0);
95  HnTrksVtx = tfs->make<TH1F>("Tracks per vtx","Tracks per vtx",8,-0.5,7.5);
96 
97  return;
98  }
art::ServiceHandle< art::TFileService > tfs

Member Data Documentation

std::string vertex::AggregateVertexAna::fDBScanModuleLabel
private

Definition at line 51 of file AggregateVertexAna_module.cc.

std::string vertex::AggregateVertexAna::fEndPointModuleLabel
private

Definition at line 55 of file AggregateVertexAna_module.cc.

art::PtrVector<recob::EndPoint2D> vertex::AggregateVertexAna::feplist
private

Definition at line 59 of file AggregateVertexAna_module.cc.

art::PtrVector<recob::Hit> vertex::AggregateVertexAna::fhitlist
private

Definition at line 58 of file AggregateVertexAna_module.cc.

std::string vertex::AggregateVertexAna::fHitModuleLabel
private

Definition at line 53 of file AggregateVertexAna_module.cc.

std::string vertex::AggregateVertexAna::fHoughModuleLabel
private

Definition at line 52 of file AggregateVertexAna_module.cc.

std::string vertex::AggregateVertexAna::fTrack3DModuleLabel
private

Definition at line 54 of file AggregateVertexAna_module.cc.

art::PtrVector<recob::Track> vertex::AggregateVertexAna::ftracklist
private

Definition at line 60 of file AggregateVertexAna_module.cc.

art::PtrVector<recob::Vertex> vertex::AggregateVertexAna::fVertexlist
private

Definition at line 61 of file AggregateVertexAna_module.cc.

std::string vertex::AggregateVertexAna::fVertexModuleLabel
private

Definition at line 56 of file AggregateVertexAna_module.cc.

TH1F* vertex::AggregateVertexAna::HnTrksVtx
private

Definition at line 46 of file AggregateVertexAna_module.cc.

TH1F* vertex::AggregateVertexAna::HnVtxes
private

Definition at line 47 of file AggregateVertexAna_module.cc.

TH2F* vertex::AggregateVertexAna::HVtxRZ
private

Definition at line 49 of file AggregateVertexAna_module.cc.

TH1F* vertex::AggregateVertexAna::HVtxSep
private

Definition at line 48 of file AggregateVertexAna_module.cc.


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