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

Public Member Functions

 SBNDCRTGeometryTest (fhicl::ParameterSet const &p)
 
 SBNDCRTGeometryTest (SBNDCRTGeometryTest const &)=delete
 
 SBNDCRTGeometryTest (SBNDCRTGeometryTest &&)=delete
 
SBNDCRTGeometryTestoperator= (SBNDCRTGeometryTest const &)=delete
 
SBNDCRTGeometryTestoperator= (SBNDCRTGeometryTest &&)=delete
 
void analyze (art::Event const &e) override
 

Detailed Description

Definition at line 26 of file SBNDCRTGeometryTest_module.cc.

Constructor & Destructor Documentation

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

Definition at line 46 of file SBNDCRTGeometryTest_module.cc.

47  : EDAnalyzer{p}
48 {}
pdgs p
Definition: selectors.fcl:22
SBNDCRTGeometryTest::SBNDCRTGeometryTest ( SBNDCRTGeometryTest const &  )
delete
SBNDCRTGeometryTest::SBNDCRTGeometryTest ( SBNDCRTGeometryTest &&  )
delete

Member Function Documentation

void SBNDCRTGeometryTest::analyze ( art::Event const &  e)
override

Definition at line 50 of file SBNDCRTGeometryTest_module.cc.

51 {
52  art::ServiceHandle<geo::Geometry const> geoService;
53 
54  std::cout << "Number of CRT AuxDets is " << geoService->NAuxDets() << std::endl;
55 
56  assert(geoService->NAuxDets() > 0);
57 
58 
59  std::vector<int> used_copynumbers_auxdet;
60  std::vector<int> used_copynumbers_sensitiveauxdet;
61 
62  for (size_t i = 0; i < geoService->NAuxDets(); i++) {
63  const geo::AuxDetGeo& adGeo = geoService->AuxDet(i);
64 
65  std::set<std::string> volNames = { adGeo.TotalVolume()->GetName() };
66  std::vector<std::vector<TGeoNode const*> > paths =
67  geoService->FindAllVolumePaths(volNames);
68 
69  std::string path = "";
70  for (size_t inode=0; inode<paths.at(0).size(); inode++) {
71  path += paths.at(0).at(inode)->GetName();
72  if (inode < paths.at(0).size() - 1) {
73  path += "/";
74  }
75  }
76 
77  TGeoManager* manager = geoService->ROOTGeoManager();
78  manager->cd(path.c_str());
79 
80  // We get the array of strips first, which is the AuxDet,
81  // then from the AuxDet, we get the strip by picking the
82  // daughter with the ID of the AuxDetSensitive, and finally
83  // from the AuxDet, we go up and pick the module and tagger
84  TGeoNode* nodeArray = manager->GetCurrentNode();
85  TGeoNode* nodeModule = manager->GetMother(1);
86  TGeoNode* nodeTagger = manager->GetMother(2);
87 
88 
89  // Ensure auxiliary detector ID and its GDML copynumber are the same
90  assert(i == (size_t)nodeModule->GetNumber());
91 
92  // Check every aux det has a different copynumber
93  auto iter = std::find(used_copynumbers_auxdet.begin(), used_copynumbers_auxdet.end(),
94  nodeModule->GetNumber());
95  assert(iter == used_copynumbers_auxdet.end());
96 
97  used_copynumbers_auxdet.push_back(nodeModule->GetNumber());
98 
99 
100  // Ensure there are CRT strips
101  assert(nodeArray->GetNdaughters() > 0);
102 
103 
104  // Ensure that the number of AuxDetSensitive in the geometry service
105  // is the same as the number of daughter nodes
106  assert((int)geoService->NAuxDetSensitive(i) == nodeArray->GetNdaughters());
107 
108  std::cout << "Auxiliary detector ID " << i
109  << " with copynumber " << nodeModule->GetNumber()
110  << "\n\t strip array name: " << nodeArray->GetName()
111  << "\n\t module name: " << nodeModule->GetName()
112  << "\n\t tagger name: " << nodeTagger->GetName() << std::endl;
113 
114  // Loop over the AuxDetSensitive volumes
115  for (int adsid = 0; adsid < nodeArray->GetNdaughters(); adsid++) {
116 
117  TGeoNode* nodeStrip = nodeArray->GetDaughter(adsid);
118 
119  std::cout << "\t\t has sensitive detector (strip) with ID " << adsid
120  << ", name: " << nodeStrip->GetName()
121  << " (copynumber " << nodeStrip->GetNumber() << ")" << std::endl;
122 
123  // Check every sensitive aux det has a different copynumber (this is used by LArG4)
124  auto iter2 = std::find(used_copynumbers_sensitiveauxdet.begin(), used_copynumbers_sensitiveauxdet.end(),
125  nodeStrip->GetNumber());
126  assert(iter2 == used_copynumbers_sensitiveauxdet.end());
127 
128  used_copynumbers_sensitiveauxdet.push_back(nodeStrip->GetNumber());
129  }
130 
131  }
132 
133 
134 }
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
const TGeoVolume * TotalVolume() const
Definition: AuxDetGeo.h:106
BEGIN_PROLOG could also be cout
SBNDCRTGeometryTest& SBNDCRTGeometryTest::operator= ( SBNDCRTGeometryTest const &  )
delete
SBNDCRTGeometryTest& SBNDCRTGeometryTest::operator= ( SBNDCRTGeometryTest &&  )
delete

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