14#include <cdc/modules/cdcGeoScan/ScanCDCGeoModule.h>
15#include <geometry/GeometryManager.h>
16#include <framework/gearbox/GearDir.h>
17#include <cdc/geometry/CDCGeometryPar.h>
30 setDescription(
"This module fills CDC geometry information in histo/tree format to a root file");
38 TH1F* h_nwires =
new TH1F(
"h_nwires",
"Number of wires in layer;CDC layer#", 56, 0.5, 56.5);
39 TH1F* h_stereo =
new TH1F(
"h_stereo",
"Stereo angle in this layer;CDC layer#", 56, 0.5, 56.5);
40 TH1F* h_swire_posF_phi =
new TH1F(
"h_swire_posF_phi",
"#phi of sense wires in forward pos;CDC layer#", 56, 0.5, 56.5);
41 TH1F* h_swire_posF_theta =
new TH1F(
"h_swire_posF_theta",
"#theta of sense wires in forward pos;CDC layer#", 56, 0.5, 56.5);
42 TH1F* h_swire_posB_phi =
new TH1F(
"h_swire_posB_phi",
"#phi of sense wires in backward pos;CDC layer#", 56, 0.5, 56.5);
43 TH1F* h_swire_posB_theta =
new TH1F(
"h_swire_posB_theta",
"#theta of sense wires in backward pos;CDC layer#", 56, 0.5, 56.5);
44 TH1F* h_fwire_iradius =
new TH1F(
"h_fwire_iradius",
"inner radius of field wires;CDC layer#", 56, 0.5, 56.5);
45 TH1F* h_fwire_oradius =
new TH1F(
"h_fwire_oradius",
"outer radius of field wires;CDC layer#", 56, 0.5, 56.5);
46 TH1F* h_width =
new TH1F(
"h_width",
"Cell Width;CDC layer#", 56, 0.5, 56.5);
47 TH1F* h_height =
new TH1F(
"h_height",
"Cell Height;CDC layer#", 56, 0.5, 56.5);
48 TH1F* h_length =
new TH1F(
"h_length",
"length of the wires;CDC layer#", 56, 0.5, 56.5);
50 B2INFO(
"Creating CDCGeometryPar object");
55 cout <<
"------| Summary-1 " << endl;
56 cout << left <<
"Number of CDC wire layers" << setw(15) <<
" " << cdcgeo.
nWireLayers() << endl;
57 cout << left <<
"Sense Wire Diameter" << setw(15) <<
" " << cdcgeo.
senseWireDiameter() << endl;
58 cout << left <<
"Field Wire Diameter" << setw(15) <<
" " << cdcgeo.
fieldWireDiameter() << endl;
60 cout <<
"------| Summary-2 " << endl;
63 << setw(10) <<
"Layer"
64 << setw(15) <<
"nwire"
65 << setw(15) <<
"radii sense"
66 << setw(15) <<
"dRdown"
68 << setw(15) <<
"Delta"
71 for (
unsigned int i = 0; i < cdcgeo.
nWireLayers(); ++i) {
74 h_nwires->SetBinContent(i + 1,
fnWires);
89 const B2Vector3D wireDir = (wirePosF - wirePosB);
95 h_length->SetBinContent(i + 1,
fclength);
99 h_width->SetBinContent(i + 1,
fcwidth);
108 h_height->SetBinContent(i + 1,
fcheight);
112 double delta = -99.0;
130 TDirectory* dhistos =
m_file->mkdir(
"histos");
133 h_swire_posF_phi->Write();
134 h_swire_posB_phi->Write();
135 h_swire_posF_theta->Write();
136 h_swire_posB_theta->Write();
138 h_fwire_iradius->Write();
139 h_fwire_oradius->Write();
144 TDirectory* dvar =
m_file->mkdir(
"vars");
147 TVectorF sWireDia(1);
149 sWireDia.Write(
"sWireDia");
151 TVectorF fWireDia(1);
153 fWireDia.Write(
"fWireDia");
160 m_file =
new TFile(
"CDCGeometryScan.root",
"RECREATE");
161 m_tree =
new TTree(
"tree",
"CDC Geometry details");
DataType Phi() const
The azimuth angle.
DataType Theta() const
The polar angle.
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
The Class for CDC Geometry Parameters.
double fieldWireDiameter() const
Returns diameter of the field wire.
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.
double senseWireDiameter() const
Returns diameter of the sense wire.
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
const double * innerRadiusWireLayer() const
Returns an array of inner radius of wire layers.
static CDCGeometryPar & Instance(const CDCGeometry *=nullptr)
Static method to get a reference to the CDCGeometryPar instance.
unsigned nWireLayers() const
Returns a number of wire layers.
const double * outerRadiusWireLayer() const
Returns an array of outer radius of wire layers.
double senseWireR(int layerId) const
Returns radius of sense wire in each layer.
void setDescription(const std::string &description)
Sets the description of the module.
TTree * m_tree
output ROOT trees
int fnWires
nwire per layer dist
double fswire_posB_phi
sense wire position in backward dir (phi) per layer dist
void bookOutput()
Create the output TFiles and TTrees.
virtual void initialize() override
init
double fstereoAng
stereo angle per layer dist
double fwire_oradius
field wire outer radius per layer dist
double fclength
wire length per layer dist
virtual void terminate() override
terminate and save information
double fcheight
cell height per layer dist
double fcwidth
cell width per layer dist
double fswire_posF_theta
sense wire position in forward dir (theta) per layer dist
double fswire_posB_theta
sense wire position in backward dir (theta) per layer dist
double fwire_iradius
field wire inner radius per layer dist
TFile * m_file
output ROOT files
ScanCDCGeoModule()
constructor
double fswire_posF_phi
sense wire position in forward dir (phi) per layer dist
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.