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