Public Member Functions | List of all members
CheckDPhaseGeometry Class Reference
Inheritance diagram for CheckDPhaseGeometry:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 CheckDPhaseGeometry (fhicl::ParameterSet const &p)
 
 CheckDPhaseGeometry (CheckDPhaseGeometry const &)=delete
 
 CheckDPhaseGeometry (CheckDPhaseGeometry &&)=delete
 
CheckDPhaseGeometryoperator= (CheckDPhaseGeometry const &)=delete
 
CheckDPhaseGeometryoperator= (CheckDPhaseGeometry &&)=delete
 
void analyze (art::Event const &e) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 33 of file CheckDPhaseGeometry_module.cc.

Constructor & Destructor Documentation

CheckDPhaseGeometry::CheckDPhaseGeometry ( fhicl::ParameterSet const &  p)
explicit

Definition at line 57 of file CheckDPhaseGeometry_module.cc.

58  :
59  EDAnalyzer(p) // ,
60  // More initializers here.
61 {;}
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
CheckDPhaseGeometry::CheckDPhaseGeometry ( CheckDPhaseGeometry const &  )
delete
CheckDPhaseGeometry::CheckDPhaseGeometry ( CheckDPhaseGeometry &&  )
delete

Member Function Documentation

void CheckDPhaseGeometry::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 63 of file CheckDPhaseGeometry_module.cc.

64 {
65  std::vector<TBox*> TPCBox;
66  std::vector<TLine*> Wires;
67 
68  double minx = 1e9;
69  double maxx = -1e9;
70  double miny = 1e9;
71  double maxy = -1e9;
72  double minz = 1e9;
73  double maxz = -1e9;
74 
75  int nwires = 0;
76 
77  // get geometry
79  /*
80  // check channel map
81  for( unsigned ch = 0; ch < geo->Nchannels(); ++ch ){
82  auto wids = geo->ChannelToWire(ch);
83  //std::cout<<ch<<" -> wids "<<wids.size()<<std::endl;
84  std::cout<<"Channel to TPC "<< ch <<" "<<wids[0].TPC<<" "<<wids[0].Plane<<" "<<wids[0].Wire<<std::endl;
85  }
86  //return;
87  */
88  std::cout<<"Total number of TPC "<<geo->NTPC()<<std::endl;
89 
90  for (geo::TPCID const& tpcid: geo->IterateTPCIDs()) {
91  size_t const t = tpcid.TPC;
92  //if (t%2==0) continue;
93  double local[3] = {0.,0.,0.};
94  double world[3] = {0.,0.,0.};
95  const geo::TPCGeo &tpc = geo->TPC(t);
96  tpc.LocalToWorld(local,world);
97  if (minx>world[0]-tpc.ActiveHalfWidth())
98  minx = world[0]-tpc.ActiveHalfWidth();
99  if (maxx<world[0]+tpc.ActiveHalfWidth())
100  maxx = world[0]+tpc.ActiveHalfWidth();
101  if (miny>world[1]-tpc.ActiveHalfHeight())
102  miny = world[1]-tpc.ActiveHalfHeight();
103  if (maxy<world[1]+tpc.ActiveHalfHeight())
104  maxy = world[1]+tpc.ActiveHalfHeight();
105  if (minz>world[2]-tpc.ActiveLength()/2.)
106  minz = world[2]-tpc.ActiveLength()/2.;
107  if (maxz<world[2]+tpc.ActiveLength()/2.)
108  maxz = world[2]+tpc.ActiveLength()/2.;
109 
110 
111  TPCBox.push_back(new TBox(world[2]-tpc.ActiveLength()/2.,
112  world[1]-tpc.ActiveHalfHeight(),
113  world[2]+tpc.ActiveLength()/2.,
114  world[1]+tpc.ActiveHalfHeight()));
115  TPCBox.back()->SetFillStyle(0);
116  TPCBox.back()->SetLineStyle(2);
117  TPCBox.back()->SetLineWidth(2);
118  TPCBox.back()->SetLineColor(16);
119 
120  // std::cout<<"TPC "<<t<<" has found "<<geo->Nplanes(t)<<" planes"<<std::endl;
121  // std::cout<<"TPC coordinates : "<<world[0]<<" "<<world[1]<<" "<<world[2]<<std::endl;
122  // std::cout<<"Drift direction : ";
123  // if(tpc.DriftDirection() == geo::kPosX) std::cout<<"geo::kPosX"<<std::endl;
124  // else if(tpc.DriftDirection() == geo::kNegX) std::cout<<"geo::kNegX"<<std::endl;
125  // else std::cout<<" Uknown drift direction"<<std::endl;
126  // std::cout<<"Drift distance : "<<tpc.DriftDistance()<<std::endl;
127  std::cout<<tpc.TPCInfo(" ", 4)<<std::endl;
128  std::cout<<std::endl;
129  // scan the planes
130  for (size_t p = 0; p<geo->Nplanes(t);++p)
131  {
132  geo::PlaneID planeID(tpcid, p);
133  const geo::PlaneGeo &vPlane = tpc.Plane( planeID );
134  auto view = vPlane.View();
135  if( view == geo::kU )
136  std::cout<<" View type geo::kU"<<std::endl;
137  else if( view == geo::kV )
138  std::cout<<" View type geo::kV"<<std::endl;
139  else if( view == geo::kX )
140  std::cout<<" View type geo::kX"<<std::endl;
141  else if( view == geo::kY )
142  std::cout<<" View type geo::kY"<<std::endl;
143  else if( view == geo::kZ )
144  std::cout<<" View type geo::kZ"<<std::endl;
145  else
146  std::cout<<" View "<<view<<" uknown"<<std::endl;
147 
148  if( geo->SignalType(planeID) == geo::kCollection )
149  std::cout<<" View is geo::kCollection"<<std::endl;
150  else if( geo->SignalType(planeID) == geo::kInduction )
151  std::cout<<" View is geo::kInduction"<<std::endl;
152  else
153  std::cout<<" View signal type is unknown"<<std::endl;
154 
155  std::cout<<" Number of wires : "<<vPlane.Nwires()<<std::endl;
156  std::cout<<" Wire pitch : "<<vPlane.WirePitch()<<std::endl;
157  std::cout<<" Theta Z : "<<vPlane.ThetaZ()<<std::endl;
158 
159  double prval = 0;
160  double refpitch = 0;
161  for (size_t w = 0; w<geo->Nwires(p,t); ++w){
162  ++nwires;
163  //++nwires_tpc[t];
164  double xyz0[3];
165  double xyz1[3];
166  unsigned int c = 0;
167 
168  if(true)
169  {
170  geo->WireEndPoints(c,t,p,w,xyz0,xyz1);
171  Wires.push_back(new TLine(xyz0[2],xyz0[1],xyz1[2],xyz1[1]));
172 
173  double pitch = 0;
174  //if( p == 0) {pitch = xyz0[1] - prval; prval = xyz0[1];}
175  //else if( p == 1) {pitch = xyz0[2] - prval; prval = xyz0[2];}
176  if( view == geo::kX ) {pitch = xyz0[0] - prval; prval = xyz0[0];}
177  else if(view == geo::kY){pitch = xyz0[1] - prval; prval = xyz0[1];}
178  else if(view == geo::kZ){pitch = xyz0[2] - prval; prval = xyz0[2];}
179  else {
180  continue;
181  //std::cerr<<"cannot determine the view\n"; break;
182  }
183  if( w == 1 ){ refpitch = pitch; }
184  if(w > 0 && fabs(pitch - refpitch) > 0.00001)
185  {
186  std::cerr<<" Bad pitch : "<<t<<" "<<p<<" "<<w<<" "<<w-1<<" "<<pitch<<" "<<refpitch<<std::endl;
187  //<<std::setprecision(15)<<xyz0[0]<<" "<<xyz0[1]<<" "<<xyz0[2]<<std::endl;
188  }
189  }
190  //std::cout<<t<<" "<<p<<" "<<w<<" "<<xyz0[0]<<" "<<xyz0[1]<<" "<<xyz0[2]<<std::endl;
191  }
192  std::cout<<std::endl;
193  }
194  //break;
195  }
196  /*
197  TCanvas *can = new TCanvas("c1","c1");
198  can->cd();
199  TH2F *frame = new TH2F("frame",";z (cm);y (cm)",3000,minz,maxz,3000,miny,maxy);
200  frame->SetStats(0);
201  frame->Draw();
202  for (auto box: TPCBox) box->Draw();
203  for (auto wire: Wires) wire->Draw();
204  can->Print("wires.pdf");
205  can->Print("wires.C");
206  std::cout<<"N wires = "<<nwires<<std::endl;
207  std::cout<<"Total number of channel wires = "<<nwires<<std::endl;
208  //for (int i = 0; i<8; ++i)
209  //{
210  //std::cout<<"TPC "<<i<<" has "<<nwires_tpc[i]<<" wires"<<std::endl;
211  //}
212  */
213 }
double ActiveHalfHeight() const
Half height (associated with y coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:99
Planes which measure V.
Definition: geo_types.h:130
Planes which measure X direction.
Definition: geo_types.h:134
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
Geometry information for a single TPC.
Definition: TPCGeo.h:38
Planes which measure Z direction.
Definition: geo_types.h:132
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
IteratorBox< TPC_id_iterator,&GeometryCore::begin_TPC_id,&GeometryCore::end_TPC_id > IterateTPCIDs() const
Enables ranged-for loops on all TPC IDs of the detector.
Planes which measure Y direction.
Definition: geo_types.h:133
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
double ThetaZ() const
Angle of the wires from positive z axis; .
Definition: PlaneGeo.cxx:726
Planes which measure U.
Definition: geo_types.h:129
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:184
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
Signal from induction planes.
Definition: geo_types.h:145
double ActiveHalfWidth() const
Half width (associated with x coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:95
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
p
Definition: test.py:223
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
double ActiveLength() const
Length (associated with z coordinate) of active TPC volume [cm].
Definition: TPCGeo.h:103
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
std::string TPCInfo(std::string indent="", unsigned int verbosity=1) const
Returns a string with information about this TPC.
Definition: TPCGeo.cxx:244
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
void WireEndPoints(geo::WireID const &wireid, double *xyzStart, double *xyzEnd) const
Fills two arrays with the coordinates of the wire end points.
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.
Definition: TPCGeo.cxx:263
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:563
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Definition: PlaneGeo.h:411
QTextStream & endl(QTextStream &s)
Signal from collection planes.
Definition: geo_types.h:146
CheckDPhaseGeometry& CheckDPhaseGeometry::operator= ( CheckDPhaseGeometry const &  )
delete
CheckDPhaseGeometry& CheckDPhaseGeometry::operator= ( CheckDPhaseGeometry &&  )
delete

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