CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
TestGeometry.cxx
Go to the documentation of this file.
1// **************************************************************************
2// authors: L. Lavezzi (univ. of Torino & INFN, Italy)
3//
4
5//include system lib
6#include <iostream>
7#include <iomanip>
8#include <string>
9#include <cmath>
10
11// Include files
12#include "GaudiKernel/AlgFactory.h"
13#include "GaudiKernel/DataObject.h"
14#include "GaudiKernel/IEventProcessor.h"
15
16#include "GaudiKernel/Incident.h"
17#include "GaudiKernel/IIncidentSvc.h"
18#include "GaudiKernel/Memory.h"
19
20#include <csignal>
21
22// for save digit & cluster
23#include "GaudiKernel/ISvcLocator.h"
24#include "GaudiKernel/IDataProviderSvc.h"
25#include "GaudiKernel/Bootstrap.h"
26#include "GaudiKernel/RegistryEntry.h"
27#include "GaudiKernel/MsgStream.h"
28
31
32#include "Identifier/CgemID.h"
34#include "RawEvent/DigiEvent.h"
37#include "GaudiKernel/SmartDataPtr.h"
38
40#include "TMath.h"
41//using namespace std;
42
43
44TestGeometry::TestGeometry(const std::string& name, ISvcLocator* pSvcLocator):
45 Algorithm(name,pSvcLocator){
46
47 declareProperty("LUTfile", lutfile = "/bes3fs/cgemCosmic/data/CGEM_cosmic_look_up_table_from_17_to_17.root");
48
49}
50
52
54 MsgStream log(msgSvc(), name());
55
56 cout << "TestGeometry initialize" << endl;
57 StatusCode sc = service("CgemGeomSvc", m_geomSvc);
58 if(sc != StatusCode::SUCCESS) {
59 log << MSG::ERROR << "can not use CgemGeomSvc" << endreq;
60 return StatusCode::FAILURE;
61 }
62
63 // LUT
64 lutreader = new CgemLUTReader(lutfile);
65 lutreader->ReadLUT();
66
67 const int nlayer = 3;
68 const int nsheet[nlayer] = {1, 2, 2};
69 const int nview = 2;
70
71 for(int ilayer = 0; ilayer < nlayer; ilayer++) {
72 for(int isheet = 0; isheet < nsheet[ilayer]; isheet++) {
73 for(int iview=0; iview < nview; iview++) {
74
75 CgemGeoReadoutPlane* anode = m_geomSvc->getReadoutPlane(ilayer, isheet);
76 int layerid = anode->getLayerId();
77 int sheetid = anode->getSheetId();
78 int nxstrip = anode->getNXstrips();
79 int nvstrip = anode->getNVstrips();
80
81 int nstrip = nxstrip;
82 if(iview==1) nstrip = nvstrip;
83
84 for(int istrip=0; istrip < nstrip; istrip++) {
85 const Identifier ident = CgemID::strip_id(layerid, sheetid, iview, istrip);
86 bool isxstrip = CgemID::is_xstrip(ident);
87 int stripid = CgemID::strip(ident);
88 double length = anode->getLength();
89 if(isxstrip==false) length = anode->getVStripLength(stripid);
90
91 cout << layerid << " " << sheetid << " " << iview << " " << stripid << " " << length << endl;
92
93
94 }
95 }
96 }
97 }
98
99
100 return StatusCode::SUCCESS;
101}
102
103
105 MsgStream log(msgSvc(), name());
106 cout << "->TestGeometry::execute" << endl;
107 cout << "geomtry service pointer " << m_geomSvc << endl;
108 return StatusCode::SUCCESS;
109}
110
111
112
114 MsgStream log(msgSvc(),name());
115 log << MSG::INFO << "TestGeometry finalize()" << endreq;
116
117 return StatusCode::SUCCESS;
118}
119
120
double length
IMessageSvc * msgSvc()
double getVStripLength(int V_ID) const
static int strip(const Identifier &id)
Definition CgemID.cxx:83
static bool is_xstrip(const Identifier &id)
Definition CgemID.cxx:64
static Identifier strip_id(int f_layer, int f_sheet, int f_strip_type, int f_strip)
Definition CgemID.cxx:89
virtual CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const =0
StatusCode execute()
TestGeometry(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize()
StatusCode finalize()