44 {
45
46
47 MsgStream log(
msgSvc(), name());
48 log << MSG::INFO << " DotsConnection initialize()" << endreq;
49
50
51
52
53
55
56 StatusCode sc = service ("MdcGeomSvc", imdcGeomSvc);
57 myMdcGeomSvc =
dynamic_cast<MdcGeomSvc*
> (imdcGeomSvc);
58 if (sc.isFailure()) {
59 return( StatusCode::FAILURE);
60 }
65
66
67
68
69
70 int nCellTot=0;
71 for(int i=0; i<nLayer; i++)
72 {
74 myNWire[i]=aLayer->
NCell();
75 myRLayer[i]=aLayer->
Radius();
76
77
78 double nomShift = aLayer->
nomShift();
79 if(nomShift>0) myWireFlag[i]=1;
80 else if(nomShift<0) myWireFlag[i]=-1;
81 else myWireFlag[i]=0;
82
83
84 nCellTot+=myNWire[i];
85 for(int j=0; j<myNWire[i]; j++)
86 {
88
89
90
91
92
93 myWirePhi[i][j]=aWire->
Forward().phi();
94 int iInnerLayer = i-1;
95 if(iInnerLayer>=0) {
96 for(int k=0; k<myNWire[iInnerLayer]; k++)
97 {
98 int k_last = k-1;
99 if(k_last<0) k_last=myNWire[iInnerLayer]-1;
100 double dphi_last = dPhi(myWirePhi[iInnerLayer][k_last], myWirePhi[i][j]);
101 double dphi = dPhi(myWirePhi[iInnerLayer][k], myWirePhi[i][j]);
102 if(dphi_last<0&&dphi>0) {
103 myInnerWire[i][j][0]=k_last;
104 myInnerWire[i][j][1]=k;
105
106 break;
107 }
108 }
109 }
110 }
111 }
112 for(int i=0; i<nLayer; i++)
113 {
114 for(int j=0; j<myNWire[i]; j++)
115 {
116 int iOuterLayer = i+1;
117 if(iOuterLayer<nLayer) {
118 for(int k=0; k<myNWire[iOuterLayer]; k++)
119 {
120 int k_last = k-1;
121 if(k_last<0) k_last=myNWire[iOuterLayer]-1;
122 double dphi_last = dPhi(myWirePhi[iOuterLayer][k_last], myWirePhi[i][j]);
123 double dphi = dPhi(myWirePhi[iOuterLayer][k], myWirePhi[i][j]);
124 if(dphi_last<0&&dphi>0) {
125 myOuterWire[i][j][0]=k_last;
126 myOuterWire[i][j][1]=k;
127
128
129 break;
130 }
131 }
132 }
133 }
134 }
135
136
137
138
139
141 sc = service ("RawDataProviderSvc", irawDataProviderSvc);
143 if ( sc.isFailure() ){
144 log << MSG::FATAL << name()<<" Could not load RawDataProviderSvc!" << endreq;
145 return StatusCode::FAILURE;
146 }
147
148
150 sc = service("MdcCalibFunSvc", imdcCalibSvc);
151 if ( sc.isSuccess() ){
153 }
154 else {
155 cout<<"DotsConnection::initialize(): can not get MdcCalibFunSvc"<<endl;
156 }
157
160 if(myNtProd&1)
161 {
162 NTuplePtr nt_ptr(
ntupleSvc(),
"TestDotsHelixFitter/trkPar");
163 if( nt_ptr ) myNtHelixFitter = nt_ptr;
164 else
165 {
166 myNtHelixFitter =
ntupleSvc()->book(
"TestDotsHelixFitter/trkPar",CLID_ColumnWiseTuple,
"trkPar");
167 if( myNtHelixFitter ) {
168 myNtHelixFitter->addItem ("run", myRUN);
169 myNtHelixFitter->addItem ("evt", myEVT);
170 myNtHelixFitter->addItem ("pid", myPID);
171 myNtHelixFitter->addItem ("Npar", myNPar, 0,5);
172 myNtHelixFitter->addIndexedItem("HelixMC", myNPar, myArrayHelixMC);
173 myNtHelixFitter->addIndexedItem("HelixFitted", myNPar, myArrayHelixFitted);
174 myNtHelixFitter->addItem ("NhitCircle", myNHitsCircle, 0,100);
175 myNtHelixFitter->addIndexedItem("LayerHitsCircle", myNHitsCircle, myLayerHitsCircle);
176 myNtHelixFitter->addIndexedItem("ChiHitsCircle", myNHitsCircle, myChiHitsCircle);
177 myNtHelixFitter->addItem ("Nhit", myNHits, 0,100);
178 myNtHelixFitter->addIndexedItem("LayerHits", myNHits, myLayerHits);
179 myNtHelixFitter->addIndexedItem("ChiHits", myNHits, myChiHits);
180 myNtHelixFitter->addItem ("NXhit", myNXHits, 0,100);
181 myNtHelixFitter->addItem ("NVhit", myNVHits, 0,100);
182 myNtHelixFitter->addItem ("NXCluster", myNXCluster, 0,100);
183 myNtHelixFitter->addItem ("NVCluster", myNVCluster, 0,100);
184 myNtHelixFitter->addItem ("TrkIdBest", myTrkIdBest);
185 myNtHelixFitter->addItem ("NHitsBestTrk", myNHitsBestTrk);
186 myNtHelixFitter->addItem ("NSameHitsBestTrk", myNSameHitsBestTrk);
187
188 }
189 }
190 }
191
192
193
194
195
196
197
198
199
200 return StatusCode::SUCCESS;
201}
void setChi2Diverge(double cut=1000000)
double Radius(void) const
double nomShift(void) const
HepPoint3D Forward(void) const
const MdcGeoWire *const Wire(unsigned id)
const int getSuperLayerSize()
const MdcGeoLayer *const Layer(unsigned id)