Belle II Software  release-05-02-19
ECLDumpGeometryModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2020 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Christopher Hearty hearty@physics.ubc.ca *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <ecl/modules/eclDumpGeometry/ECLDumpGeometryModule.h>
12 #include <ecl/geometry/ECLGeometryPar.h>
13 
14 using namespace Belle2;
15 using namespace std;
16 
17 
18 //-----------------------------------------------------------------
19 // Register the Module
20 //-----------------------------------------------------------------
21 REG_MODULE(ECLDumpGeometry)
22 
23 //-----------------------------------------------------------------
24 // Implementation
25 //-----------------------------------------------------------------
26 
28 {
29  // Set module properties
30  setDescription("Print out location of every crystal");
31  setPropertyFlags(c_ParallelProcessingCertified);
32 }
33 
34 
36 {
37 }
38 
39 
41 {
42  if (firstEvent) {
43  firstEvent = false;
44 
45  //..ECL geometry
47  std::printf("\nLocation and direction of the axis of each ECL crystal\n");
48  std::printf("cellID x y z axisTheta axisPhi \n");
49  for (int cellID = 1; cellID <= 8736; cellID++) {
50  TVector3 pos = eclGeometry->GetCrystalPos(cellID - 1);
51  TVector3 dir = eclGeometry->GetCrystalVec(cellID - 1);
52  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());
53  }
54  std::printf("\n\n");
55  }
56 }
57 
58 
Belle2::ECL::ECLGeometryPar::GetCrystalVec
TVector3 GetCrystalVec(int cid)
The direction of crystal.
Definition: ECLGeometryPar.h:110
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::ECLDumpGeometryModule
Dump location and direction of all ECL crystals.
Definition: ECLDumpGeometryModule.h:39
Belle2::ECLDumpGeometryModule::initialize
virtual void initialize() override
Register input and output data.
Definition: ECLDumpGeometryModule.cc:35
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::ECL::ECLGeometryPar::Instance
static ECLGeometryPar * Instance()
Static method to get a reference to the ECLGeometryPar instance.
Definition: ECLGeometryPar.cc:151
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECL::ECLGeometryPar::GetCrystalPos
TVector3 GetCrystalPos(int cid)
The Position of crystal.
Definition: ECLGeometryPar.h:102
Belle2::ECL::ECLGeometryPar
The Class for ECL Geometry Parameters.
Definition: ECLGeometryPar.h:45
Belle2::ECLDumpGeometryModule::event
virtual void event() override
Event.
Definition: ECLDumpGeometryModule.cc:40