81 {
83 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
84 MsgStream log(
msgSvc,
"ResiAlign");
85 log << MSG::INFO << "ResiAlign::initialize()" << endreq;
86
87 m_hlist = hlist;
88 m_mdcGeomSvc = mdcGeomSvc;
89 m_mdcFunSvc = mdcFunSvc;
90 m_mdcUtilitySvc = mdcUtilitySvc;
91
92 double zeast;
93 for(int lay=0; lay<43; lay++){
95 m_zrange[lay][1] = 2.0 * fabs(zeast) / (double)m_ndiv;
96 m_zrange[lay][0] = -1.0 * m_zrange[lay][1];
97
99 }
100
101 for(
int wir=0; wir<
WIRENMAX; wir++){
105 m_xw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().x();
106 m_yw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().y();
107 m_zw[wir] = m_mdcGeomSvc->
Wire(wir)->
Forward().z();
108 }
109
110 char hname[200];
111 int iEP;
112
113 INTupleSvc* ntupleSvc;
114 Gaudi::svcLocator() -> service("NTupleSvc", ntupleSvc);
115 for(iEP=0; iEP<=
NEP; iEP++){
116 if(iEP <
NEP)
sprintf(hname,
"FILE137/align%02d", iEP);
117 else sprintf(hname,
"FILE137/alignAll");
118
119 NTuplePtr nt(ntupleSvc, hname);
120 if( nt ) m_tuple[iEP] = nt;
121 else{
122 m_tuple[iEP] =
ntupleSvc->book(hname, CLID_ColumnWiseTuple,
"align");
123 if (m_tuple[iEP]) {
124 m_tuple[iEP]->addItem ("run", m_iRun[iEP]);
125 m_tuple[iEP]->addItem ("evt", m_iEvt[iEP]);
126 m_tuple[iEP]->addItem ("resi", m_resi[iEP]);
127 m_tuple[iEP]->addItem ("p", m_p[iEP]);
128 m_tuple[iEP]->addItem ("pt", m_pt[iEP]);
129 m_tuple[iEP]->addItem ("phi", m_phi[iEP]);
130 m_tuple[iEP]->addItem ("lay", m_lay[iEP]);
131 m_tuple[iEP]->addItem ("lr", m_lr[iEP]);
132 m_tuple[iEP]->addItem ("cel", m_cel[iEP]);
133 }
134 else {
135 log << MSG::FATAL << "Cannot book N-tuple:"
136 << long(m_tuple[iEP]) << endmsg;
137 }
138 }
139 }
140
141 m_hnTrk = new TH1F("HNtrack", "", 10, -0.5, 9.5);
142 m_hlist->Add(m_hnTrk);
143
144 m_hnHit = new TH1F("HNhit", "", 100, -0.5, 99.5);
145 m_hlist->Add(m_hnHit);
146
147 m_hlayHitmap = new TH1F("Hitmap", "", 43, -0.5, 42.5);
148 m_hlist->Add(m_hlayHitmap);
149
150 m_hresAll = new TH1F("HResAllInc", "", 200, -1.0, 1.0);
151 m_hlist->Add(m_hresAll);
152
153 m_hresInn = new TH1F("HResInnInc", "", 200, -1.0, 1.0);
154 m_hlist->Add(m_hresInn);
155
156 m_hresStp = new TH1F("HResStpInc", "", 200, -1.0, 1.0);
157 m_hlist->Add(m_hresStp);
158
159 m_hresOut = new TH1F("HResOutInc", "", 200, -1.0, 1.0);
160 m_hlist->Add(m_hresOut);
161
162 int lay;
164 sprintf(hname,
"Res_Layer%02d", lay);
165 m_hresLay[lay] = new TH1F(hname, "", 200, -1.0, 1.0);
166 m_hlist->Add(m_hresLay[lay]);
167
168 for(int i=0; i<4; i++){
169 if(0==i)
sprintf(hname,
"Resi_Lay%02d_Up_L", lay);
170 else if(1==i)
sprintf(hname,
"Resi_Lay%02d_Up_R", lay);
171 else if(2==i)
sprintf(hname,
"Resi_Lay%02d_Dw_L", lay);
172 else sprintf(hname,
"Resi_Lay%02d_Dw_R", lay);
173 m_hresLay_LR[lay][i] = new TH1F(hname, "", 200, -1.0, 1.0);
174 m_hlist->Add(m_hresLay_LR[lay][i]);
175 }
176 }
177
178 for(iEP=0; iEP<
NEP; iEP++){
179 m_gr[iEP] = new TGraph();
180 sprintf(hname,
"grResi%02d", iEP);
181 m_gr[iEP]->SetName(hname);
182 m_hlist->Add(m_gr[iEP]);
183 }
184 m_fevt.open("evt.txt");
185}
virtual const MdcGeoLayer *const Layer(unsigned id)=0
virtual const MdcGeoWire *const Wire(unsigned id)=0
double Radius(void) const
HepPoint3D Forward(void) const
HepPoint3D Backward(void) const