Belle II Software  release-06-00-14
ECLDumpGeometryModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <ecl/modules/eclDumpGeometry/ECLDumpGeometryModule.h>
10 #include <ecl/geometry/ECLGeometryPar.h>
11 
12 using namespace Belle2;
13 using namespace std;
14 
15 
16 //-----------------------------------------------------------------
17 // Register the Module
18 //-----------------------------------------------------------------
19 REG_MODULE(ECLDumpGeometry)
20 
21 //-----------------------------------------------------------------
22 // Implementation
23 //-----------------------------------------------------------------
24 
26 {
27  // Set module properties
28  setDescription("Print out location of every crystal");
29  setPropertyFlags(c_ParallelProcessingCertified);
30 }
31 
32 
34 {
35 }
36 
37 
39 {
40  if (firstEvent) {
41  firstEvent = false;
42 
43  //..ECL geometry
45  std::printf("\nLocation and direction of the axis of each ECL crystal\n");
46  std::printf("cellID x y z axisTheta axisPhi \n");
47  for (int cellID = 1; cellID <= 8736; cellID++) {
48  TVector3 pos = eclGeometry->GetCrystalPos(cellID - 1);
49  TVector3 dir = eclGeometry->GetCrystalVec(cellID - 1);
50  std::printf("%6d %9.4f %9.4f %9.4f %9.6f %9.6f\n", cellID, pos.X(), pos.Y(), pos.Z(), dir.Theta(), dir.Phi());
51  }
52  std::printf("\n\n");
53  }
54 }
55 
56 
Dump location and direction of all ECL crystals.
virtual void initialize() override
Register input and output data.
virtual void event() override
Event.
The Class for ECL Geometry Parameters.
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
TVector3 GetCrystalVec(int cid)
The direction of crystal.
TVector3 GetCrystalPos(int cid)
The Position of crystal.
Base class for Modules.
Definition: Module.h:72
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.