124 #include "StMessMgr.h"
125 #include "StEvent/StFcsHit.h"
126 #include "StEvent/StFcsCluster.h"
127 #include "StEvent/StFcsPoint.h"
132 float mEtGain[kFcsNDet][kFcsMaxId];
135 short mMap_ehp[kFcsNDet][kFcsMaxId];
136 short mMap_ns [kFcsNDet][kFcsMaxId];
137 short mMap_crt[kFcsNDet][kFcsMaxId];
138 short mMap_slt[kFcsNDet][kFcsMaxId];
139 short mMap_dep[kFcsNDet][kFcsMaxId];
140 short mMap_ch [kFcsNDet][kFcsMaxId];
141 short mMap_ppb[kFcsNDet][kFcsMaxId];
142 short mMap_ppp[kFcsNDet][kFcsMaxId];
143 short mMap_pph[kFcsNDet][kFcsMaxId];
144 short mMap_wcol[kFcsNDet][kFcsMaxId];
145 short mMap_jcol[kFcsNDet][kFcsMaxId];
148 short mRMap_det[kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxDepCh];
149 short mRMap_id [kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxDepCh];
150 short mRMap_crt[kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxDepCh];
151 short mRMap_slt[kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxDepCh];
154 const unsigned short kFcsMaxBranch=2;
155 const unsigned short kFcsMaxAddr=16;
156 const unsigned short kFcsMaxSiPM=4;
157 short mScMap_ehp[kFcsNDet][kFcsMaxId];
158 short mScMap_ns[kFcsNDet][kFcsMaxId];
159 short mScMap_dep[kFcsNDet][kFcsMaxId];
160 short mScMap_bra[kFcsNDet][kFcsMaxId];
161 short mScMap_add[kFcsNDet][kFcsMaxId];
162 short mScMap_sipm[kFcsNDet][kFcsMaxId];
163 short mScMap_pp[kFcsNDet][kFcsMaxId];
164 short mScMap_j[kFcsNDet][kFcsMaxId];
167 short mRScMap_det[kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxBranch][kFcsMaxAddr][kFcsMaxSiPM];
168 short mRScMap_id[kFcsEHP][kFcsNorthSouth][kFcsMaxDepBd][kFcsMaxBranch][kFcsMaxAddr][kFcsMaxSiPM];
171 const short EPPMap[8][6][3]={
172 {{20, 0, 1},{20, 1,-1},
173 { 0, 0, 2},{ 0, 1,-1},
174 { 1, 0, 3},{ 1, 1,-1}},
175 {{ 2, 0,-2},{ 2, 1,-1},
176 { 3, 0,-2},{ 3, 1,-1},
177 { 4, 0,-2},{ 4, 1,-1}},
178 {{22, 0, 4},{23, 0,-1},
179 { 5, 0, 5},{ 5, 1,-1},
180 { 6, 0, 6},{ 6, 1,-1}},
181 {{ 7, 0, 7},{ 7, 1,-1},
182 { 8, 0, 8},{ 8, 1,-1},
183 { 9, 0, 9},{ 9, 1,-1}},
184 {{10, 0,10},{10, 1,-1},
185 {11, 0,11},{11, 1,-1},
186 {12, 0,12},{12, 1,-1}},
187 {{13, 0,13},{13, 1,-1},
188 {14, 0,14},{14, 1,-1},
189 {22, 1,15},{23, 1,-1}},
190 {{15, 0,-2},{15, 1,-1},
191 {16, 0,-2},{16, 1,-1},
192 {17, 0,-2},{17, 1,-1}},
193 {{18, 0,16},{18, 1,-1},
194 {19, 0,17},{19, 1,-1},
195 {21, 0,-1},{21, 1,-1}}
197 const short HPPMap[4][6][3]={
198 {{ 6, 0, 1},{ 6, 1,-1},
199 { 0, 0, 2},{ 1, 0,-1},
200 {-1,-1,-1},{-1,-1,-1}},
201 {{ 2, 0, 3},{ 0, 1,-1},
202 { 1, 1, 4},{ 2, 1,-1},
203 { 8, 0, 5},{-1,-1,-1}},
204 {{ 8, 1, 6},{-1,-1,-1},
205 { 3, 0, 7},{ 4, 0,-1},
206 { 5, 0, 8},{ 3, 1,-1}},
207 {{ 4, 1, 9},{ 5, 1,-1},
208 { 7, 0,10},{ 7, 1,-1},
209 {-1,-1,-1},{-1,-1,-1}}
212 short EMapPPB[24][2];
213 short EMapPPP[24][2];
218 short HMapPPB[24][2];
219 short HMapPPP[24][2];
225 const char* colW[4]={
"Green ",
"Brown ",
"Orange",
"Blue "};
226 const char* colJ[8]={
"Blue ",
"Orange",
"Violet",
"Black ",
227 "Yellow",
"Red ",
"Grey ",
"Blue "};
228 const float leng[8]={ 6.5, 6.5, 5.0, 5.0,
230 const char* colJH[8]={
"Red ",
"Grey ",
"Orange",
"Yellow",
231 "Orange",
"Blue ",
"Red ",
"Yellow"};
232 const float lengH[8]={ 6.5, 5.0, 5.0, 5.0,
235 const char* EHP[3]={
"Ecal",
"Hcal",
"Pres"};
236 const char* CRT[5]={
"EN",
"MN",
"MA",
"MS",
"ES"};
237 const char* DET[6]={
"EN",
"ES",
"HN",
"HS",
"PN",
"PS"};
244 StFcsDb::~StFcsDb() {}
256 if(!t) { memset(&mFcsDetectorPosition,0,
sizeof(fcsDetectorPosition_st)); }
257 else { memcpy(&mFcsDetectorPosition,t,
sizeof(fcsDetectorPosition_st)); }
261 if(!t) { memset(&mFcsEcalGain,0,
sizeof(fcsEcalGain_st)); }
262 else { memcpy(&mFcsEcalGain,t,
sizeof(fcsEcalGain_st)); }
266 if(!t) { memset(&mFcsHcalGain,0,
sizeof(fcsHcalGain_st)); }
267 else { memcpy(&mFcsHcalGain,t,
sizeof(fcsHcalGain_st)); }
271 if(!t) { memset(&mFcsPresGain,0,
sizeof(fcsPresGain_st)); }
272 else { memcpy(&mFcsPresGain,t,
sizeof(fcsPresGain_st)); }
276 if(!t) { memset(&mFcsEcalGainCorr,0,
sizeof(fcsEcalGainCorr_st)); }
277 else { memcpy(&mFcsEcalGainCorr,t,
sizeof(fcsEcalGainCorr_st)); }
281 if(!t) { memset(&mFcsHcalGainCorr,0,
sizeof(fcsHcalGainCorr_st)); }
282 else { memcpy(&mFcsHcalGainCorr,t,
sizeof(fcsHcalGainCorr_st)); }
286 if(!t) { memset(&mFcsPresValley,0,
sizeof(fcsPresValley_st)); }
287 else { memcpy(&mFcsPresValley,t,
sizeof(fcsPresValley_st)); }
291 if(!t) { memset(&mFcsEcalGainOnline,0,
sizeof(fcsEcalGainOnline_st)); }
292 else { memcpy(&mFcsEcalGainOnline,t,
sizeof(fcsEcalGainOnline_st)); }
296 if(!t) { memset(&mFcsHcalGainOnline,0,
sizeof(fcsHcalGainOnline_st)); }
297 else { memcpy(&mFcsHcalGainOnline,t,
sizeof(fcsHcalGainOnline_st)); }
301 if(!t) { memset(&mFcsPresThreshold,0,
sizeof(fcsPresThreshold_st)); }
302 else { memcpy(&mFcsPresThreshold,t,
sizeof(fcsPresThreshold_st)); }
305 int StFcsDb::InitRun(
int runNumber) {
306 LOG_INFO <<
"StFcsDb::InitRun - run = " << runNumber << endm;
309 if(20000000<mRun && mRun<23027048) mEtGainMode=1;
324 if(mGainMode==GAINMODE::DB){
325 int ie=0, ih=0, ip=0, ehp, ns, crt, slt, dep, ch;
326 for(
int ins=0; ins<kFcsNorthSouth; ins++){
327 int det=kFcsEcalNorthDetId+ins;
328 for(
int id=0;
id<
maxId(det);
id++){
330 mGain[ehp][ns][dep][ch]=mFcsEcalGain.gain[ie];
333 det=kFcsHcalNorthDetId+ins;
334 for(
int id=0;
id<
maxId(det);
id++){
336 mGain[ehp][ns][dep][ch]=mFcsHcalGain.gain[ih];
339 det=kFcsPresNorthDetId+ins;
340 for(
int id=0;
id<
maxId(det);
id++){
342 mGain[ehp][ns][dep][ch]=mFcsPresGain.gain[ip];
346 }
else if(mGainMode==GAINMODE::TXT){
350 if(mGainCorrMode==GAINMODE::DB){
351 int ie=0, ih=0, ip=0, ehp, ns, crt, slt, dep, ch;
352 for(
int ins=0; ins<kFcsNorthSouth; ins++){
353 int det=kFcsEcalNorthDetId+ins;
354 for(
int id=0;
id<
maxId(det);
id++){
356 mGainCorr[ehp][ns][dep][ch]=mFcsEcalGainCorr.gaincorr[ie];
359 det=kFcsHcalNorthDetId+ins;
360 for(
int id=0;
id<
maxId(det);
id++){
362 mGainCorr[ehp][ns][dep][ch]=mFcsHcalGainCorr.gaincorr[ih];
365 det=kFcsPresNorthDetId+ins;
366 for(
int id=0;
id<
maxId(det);
id++){
368 mGainCorr[ehp][ns][dep][ch]=mFcsPresValley.valley[ip];
372 }
else if(mGainCorrMode==GAINMODE::TXT){
373 readGainCorrFromText();
376 int ie=0, ih=0, ip=0, ehp, ns, crt, slt, dep, ch;
377 for(
int ins=0; ins<kFcsNorthSouth; ins++){
378 int det=kFcsEcalNorthDetId+ins;
379 for(
int id=0;
id<
maxId(det);
id++){
381 mGainOnline[ehp][ns][dep][ch]=mFcsEcalGainOnline.gainOnline[ie];
384 det=kFcsHcalNorthDetId+ins;
385 for(
int id=0;
id<
maxId(det);
id++){
387 mGainOnline[ehp][ns][dep][ch]=mFcsHcalGainOnline.gainOnline[ih];
390 det=kFcsPresNorthDetId+ins;
391 for(
int id=0;
id<
maxId(det);
id++){
393 mGainOnline[ehp][ns][dep][ch]=mFcsPresThreshold.threshold[ip];
402 vertexSeed_st* vSeed = ((St_vertexSeed*) (dbDataSet->FindObject(
"vertexSeed")))->GetTable();
406 mVdxdz = vSeed->dxdz;
407 mVdydz = vSeed->dydz;
408 mThetaX = TMath::ATan( mVdxdz );
409 mThetaY = TMath::ATan( mVdydz );
419 if(eh>=0 && eh<kFcsEHP && ns>=0 && ns<kFcsNorthSouth)
return eh*2 + ns;
424 if(det==0 || det==1)
return 0;
425 if(det==2 || det==3)
return 1;
426 if(det==4 || det==5)
return 2;
439 if (ehp==0){
return 8;}
440 else if(ehp==1){
return 4;}
441 else if(ehp==2){
return 9;}
444 if (ehp==0){
return kFcsEcalNRow;}
445 else if(ehp==1){
return kFcsHcalNRow;}
446 else if(ehp==2){
return kFcsPresNRow;}
456 if (ehp==0){
return 8;}
457 else if(ehp==1){
return 4;}
458 else if(ehp==2){
return 1;}
461 if (ehp==0){
return kFcsEcalNCol;}
462 else if(ehp==1){
return kFcsHcalNCol;}
463 else if(ehp==2){
return kFcsPresNCol;}
473 if (ehp==0){
return 64;}
474 else if(ehp==1){
return 16;}
475 else if(ehp==2){
return 9;}
478 if (ehp==0){
return kFcsEcalMaxId;}
479 else if(ehp==1){
return kFcsHcalMaxId;}
480 else if(ehp==2){
return kFcsPresMaxId;}
486 if(id<0 || id>=
maxId(det))
return -1;
491 if(id<0 || id>=
maxId(det))
return -1;
496 if(row<=0 || row>
nRow(det) ||
nRow(det)<0)
return -1;
497 if(col<=0 || col>
nColumn(det) ||
nRow(det)<0)
return -1;
498 return col - 1 +
nColumn(det)*(row-1);
502 return dep*kFcsMaxDepCh + ch;
506 int ehp,ns,crt,slt,dep,ch;
511 int scehp,scns,scdep,br,i2c,sipm,pp,j;
512 getSCmap(det,
id,scehp,scns,scdep,br,i2c,sipm,pp,j);
513 sprintf(name,
"%2s%03d_r%02dc%02d_Dep%02dCh%02d_F%02d/%1d/%02d/%1d",
514 DET[det],
id,r,c,dep,ch,scdep,br,i2c,sipm);
518 sprintf(name,
"%2s%03d_r%02dc%02d_Dep%02dCh%02d_PP%02d%1sTT%02d",
519 DET[det],
id,r,c,dep,ch,pp,tt%2==0?
"E":
"O",tt);
528 sprintf(name,
"%2s---_r--c--_Dep%02dCh%02d_F--/-/--/-",
534 int scehp,scns,scdep,br,i2c,sipm,pp,j;
535 getSCmap(det,
id,scehp,scns,scdep,br,i2c,sipm,pp,j);
536 sprintf(name,
"%2s%03d_r%02dc%02d_Dep%02dCh%02d_F%02d/%1d/%02d/%1d",
537 DET[det],
id,r,c,dep,ch,scdep,br,i2c,sipm);
541 sprintf(name,
"%2s%03d_r%02dc%02d_Dep%02dCh%02d_PP%02d%1s/TT%02d",
542 DET[det],
id,r,c,dep,ch,pp,tt%2==0?
"E":
"O",tt);
549 int r,c,dep,ch,scdep,br,i2c,sipm;
550 sscanf(name,
"%2s%03d_r%02dc%02d_Dep%02dCh%02d_F%02d/%1d/%02d/%1d",
551 detname,&
id,&r,&c,&dep,&ch,&scdep,&br,&i2c,&sipm);
557 if ( detname==
"EN") {
return 0;}
558 else if( detname==
"ES") {
return 1;}
559 else if( detname==
"HN") {
return 2;}
560 else if( detname==
"HS") {
return 3;}
561 else if( detname==
"PN") {
return 4;}
562 else if( detname==
"PS") {
return 5;}
564 LOG_ERROR <<
"ERROR:Invalid name for detector;Input:"<<detname<<endm;
569 unsigned short StFcsDb::getKey(
unsigned short detid,
unsigned short id){
return ( (detid & 0x7)<<12 | (
id & 0xffff) ); }
570 void StFcsDb::getDetIdFromKey(
unsigned short key,
unsigned short& detid,
unsigned short&
id)
572 detid = (key >> 12) & 0x0007;
575 unsigned short StFcsDb::getDetFromKey(
unsigned short key){
return (key >> 12) & 0x0007; }
576 unsigned short StFcsDb::getIdFromKey(
unsigned short key) {
return (key & 0x0fff); }
580 const float bOffY=-(17.0*5.81);
597 if( det%2==0 ){ detangle *= -1.0; }
598 xoff = zdepth*sin(detangle);
599 zoff = zdepth*cos(detangle);
602 if(det==0)
return StThreeVectorD(-17.399+xoff, -5.26, 710.16+zoff);
603 if(det==1)
return StThreeVectorD( 17.399+xoff, -5.26, 710.16+zoff);
604 if(det==2)
return StThreeVectorD(-21.285+xoff, +1.80, 782.63+zoff);
605 if(det==3)
return StThreeVectorD( 21.285+xoff, +1.80, 782.63+zoff);
610 mFcsDetectorPosition.yoff[det],
611 mFcsDetectorPosition.zoff[det]+zoff);
618 if(det==0)
return 1.73;
619 if(det==1)
return 1.73;
620 if(det==2)
return 1.73;
621 if(det==3)
return 1.73;
622 if(det==4)
return 0.0;
623 if(det==5)
return 0.0;
628 if(det==0)
return 5.542+0.03;
629 if(det==1)
return 5.542+0.03;
630 if(det==2)
return 9.99+0.00;
631 if(det==3)
return 9.99+0.00;
640 if(det==0 || det==1) {
return 30.97;}
641 if(det==2 || det==3) {
return 84.24;}
645 float StFcsDb::getShowerMaxZ(
int det)
const{
646 if(det==0 || det==1)
return 15.0;
647 if(det==2 || det==3)
return 25.0;
661 if(mLeakyHcal==1 && (det==kFcsHcalNorthDetId || det==kFcsHcalSouthDetId)){
664 }
else if(col==kFcsHcalNCol){
679 int c1=0, c2=0, r1=0, r2=0;
680 if(det<=kFcsEcalSouthDetId){
685 }
else if(det<=kFcsHcalSouthDetId){
699 double ecalD = sqrt(ecalfront.x()*ecalfront.x() + ecalfront.z()*ecalfront.z());
700 double hcalD = sqrt(hcalfront.x()*hcalfront.x() + ecalfront.z()*hcalfront.z());
701 double ecalSMD = ecalD + getShowerMaxZ(ns);
702 double hcalSMD = hcalD + getShowerMaxZ(ns+2);
703 double hcalLocalcm = hcalLocalX *
getXWidth(ns+2);
704 return hcalLocalcm*ecalSMD/hcalSMD;
707 LOG_INFO <<
"Need to be implememted!!!"<<endm;
716 double ecalSMD = ecalfront.z() + getShowerMaxZ(ns) - zvtx;
717 double hcalSMD = hcalfront.z() + getShowerMaxZ(ns+2) - zvtx;
718 double hcalLocalcm = hcalLocalY *
getYWidth(ns+2);
719 double hcalStar = double(
nRow(ns+2))/2.0*
getYWidth(ns+2)+hcalfront.y()-hcalLocalcm;
720 double hcalatEcal = hcalStar*ecalSMD/hcalSMD;
721 return double(
nRow(ns))/2.0*
getYWidth(ns) + ecalfront.y() - hcalatEcal;
728 if(eNS!=hNS)
return 1000;
735 return sqrt(dX*dX + dY*dY);
742 if(eNS!=hNS)
return 1000;
749 return sqrt(dX*dX + dY*dY);
755 if( det%2==0 ){ detangle *= -1.0; }
757 double planenormal[3] = {sin(detangle),0,cos(detangle)};
764 if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=1; }
765 if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=1; }
773 if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=3; }
774 if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=3; }
782 if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=1; }
783 if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=1; }
791 if( g2ttrk->p[2]>=0 && g2ttrk->p[0]>=0 ){ det=3; }
792 if( g2ttrk->p[2]<0 && g2ttrk->p[0]<0 ){ det=3; }
798 double linedir[3] = {g2ttrk->p[0],g2ttrk->p[1],g2ttrk->p[2]};
800 int vertind = g2ttrk->start_vertex_p - 1;
801 double linestart[3] = {g2tvert[vertind].ge_x[0],g2tvert[vertind].ge_x[1],g2tvert[vertind].ge_x[2]};
803 return projectLine(det, linedir, linestart, showermaxz);
806 double zero[3] = {0,0,0};
812 double linedir[3] = {linedirection.x(),linedirection.y(),linedirection.z()};
813 double linestart[3] = {lineorigin.x(),lineorigin.y(),lineorigin.z()};
814 return projectLine(det,linedir,linestart,showermaxz);
819 if( showermaxz<0 ){ showermaxz = getShowerMaxZ(det); }
821 if( linedirection[2]>=0 && linedirection[0]>=0 ){ LOG_WARN <<
"Incorrect Det" << endm; }
822 if( linedirection[2]<0 && linedirection[0]<=0 ){ LOG_WARN <<
"Incorrect Det" << endm; }
825 if( linedirection[2]>=0 && linedirection[0]<0 ){ LOG_WARN <<
"Incorrect Det" << endm; }
826 if( linedirection[2]<0 && linedirection[0]>=0 ){ LOG_WARN <<
"Incorrect Det" << endm; }
829 if( det%2==0 ){ detangle *= -1.0; }
833 double tintersection =
834 (planenormal.x()*(xyzoff.x()-lineorigin[0])+planenormal.y()*(xyzoff.y()-lineorigin[1])+planenormal.z()*(xyzoff.z()-lineorigin[2])) /
835 (planenormal.x()*linedirection[0]+planenormal.y()*linedirection[1]+planenormal.z()*linedirection[2]);
837 return StThreeVectorD( linedirection[0]*tintersection+lineorigin[0], linedirection[1]*tintersection+lineorigin[1], linedirection[2]*tintersection+lineorigin[2] );
842 return getStarXYZ(hit->detectorId(),hit->id(),FcsZ);
869 if(FcsZ<0.0) FcsZ = getShowerMaxZ(det);
870 double x = 0.0, y=0.0, z=0.0;
873 y = off.y() + (double(
nRow(det)) / 2.0 *
getYWidth(det)) - FcsY;
875 x = off.x() - FcsX * cos(a) - FcsZ * sin(a);
876 z = off.z() + FcsZ * cos(a) - FcsX * sin(a);
878 x = off.x() + FcsX * cos(a) + FcsZ * sin(a);
879 z = off.z() + FcsZ * cos(a) - FcsX * sin(a);
882 if(mDebug>1) LOG_DEBUG << Form(
"getStarXYZ XOFF=%f YOFF=%f ZOFF=%f Angle=%f : x=%f y=%f z=%f",
883 off.x(),off.y(),off.z(),a,x,y,z) << endm;
888 return (
getStarXYZ(det,FcsX,FcsY,FcsZ)).phi();
891 float StFcsDb::getEta(
int det,
float FcsX,
float FcsY,
float FcsZ,
float zVertex)
const{
892 return (
getStarXYZ(det,FcsX,FcsY,FcsZ,zVertex)).pseudoRapidity();
899 xyznew.rotateX(+mThetaY);
900 xyznew.rotateY(-mThetaX);
904 LOG_DEBUG << Form(
"mVx=%8.4f mVdxdz=%8.4f mThetaX=%8.4f",mVx,mVdxdz,mThetaX) << endm;
905 LOG_DEBUG << Form(
"mVy=%8.4f mVdydz=%8.4f mThetaY=%8.4f",mVy,mVdydz,mThetaY) << endm;
906 LOG_DEBUG << Form(
"xyz = %lf %lf %lf",xyz.x(), xyz.y(), xyz.z()) << endm;
907 LOG_DEBUG << Form(
"xyz rot = %lf %lf %lf",xyznew.x(), xyznew.y(), xyznew.z()) << endm;
908 LOG_DEBUG << Form(
"p = %lf %lf %lf %lf",mom3.x(), mom3.y(), mom3.z(),e) << endm;
914 if(det==0 || det==1)
return 0.2;
915 if(det==2 || det==3)
return 0.0145;
916 if(det==4 || det==5)
return 2.0;
925 return getGain(hit->detectorId(), hit->id());
929 if(det>=0 && det<kFcsNDet && id>=0 &&
id<
maxId(det)) {
931 case GAINMODE::FIXED :
932 if(det<=kFcsHcalSouthDetId)
return 0.0053;
934 case GAINMODE::FORCED :
935 if(det<=kFcsEcalSouthDetId)
return mForceUniformGainEcal;
936 if(det<=kFcsHcalSouthDetId)
return mForceUniformGainHcal;
937 if(det<=kFcsPresSouthDetId)
return mForceUniformGainPres;
940 int ehp,ns,dep,ch,crt,slt;
942 return mGain[ehp][ns][dep][ch];
953 if(det>=0 && det<kFcsNDet && id>=0 &&
id<
maxId(det)) {
954 switch(mGainCorrMode){
955 case GAINMODE::FIXED :
956 if(det<=kFcsHcalSouthDetId)
return 1.0;
958 case GAINMODE::FORCED :
959 if(det<=kFcsEcalSouthDetId)
return mForceUniformGainCorrectionEcal;
960 if(det<=kFcsHcalSouthDetId)
return mForceUniformGainCorrectionHcal;
961 if(det<=kFcsPresSouthDetId)
return mForceUniformGainCorrectionPres;
964 int ehp,ns,dep,ch,crt,slt;
966 return mGainCorr[ehp][ns][dep][ch];
985 switch(mGainOnlineMode){
986 case GAINMODE::FORCED :
987 if(det<=kFcsEcalSouthDetId)
return mForceUniformGainOnlineEcal;
988 if(det<=kFcsHcalSouthDetId)
return mForceUniformGainOnlineHcal;
989 if(det<=kFcsPresSouthDetId)
return mForceUniformGainOnlinePres;
992 if(det>=0 && det<kFcsNDet && id>=0 &&
id<
maxId(det)) {
993 int ehp,ns,dep,ch,crt,slt;
995 return mGainOnline[ehp][ns][dep][ch];
1011 return getGain8(hit->detectorId(), hit->id());
1019 ehp=-1; ns=-1; crt=-1; slt=-1; dep=-1; ch=-1;
1020 if(detectorId<0 || detectorId>=kFcsNDet)
return;
1021 if(id<0 || id>=kFcsMaxId)
return;
1032 detectorId=6;
id=4095; crt=0; slt=0;
1033 if(ehp<0 || ehp>=kFcsEHP)
return;
1034 if(ns<0 || ns>=kFcsNorthSouth)
return;
1035 if(dep<0 || dep>=kFcsMaxDepBd)
return;
1036 if(ch<0 || ch>=kFcsMaxDepCh)
return;
1037 detectorId = mRMap_det[ehp][ns][dep][ch];
1038 id = mRMap_id [ehp][ns][dep][ch];
1039 crt = mRMap_crt[ehp][ns][dep][ch];
1040 slt = mRMap_slt[ehp][ns][dep][ch];
1066 int &ehp,
int &ns,
int &scdep,
int &branch,
int &fee_i2c,
int &sipm,
1067 int &pp,
int &jacket)
const{
1068 ehp=-1; ns=-1; scdep=-1; branch=-1; fee_i2c=-1; sipm=-1, pp=-1; jacket=-1;
1069 if(det<0 || det>=kFcsNDet)
return;
1070 if(id<0 || id>=kFcsMaxId)
return;
1071 ehp=mScMap_ehp[det][id];
1072 ns=mScMap_ns[det][id];
1073 scdep=mScMap_dep[det][id];
1074 branch=mScMap_bra[det][id];
1075 fee_i2c= mScMap_add[det][id];
1076 sipm=mScMap_sipm[det][id];
1077 pp=mScMap_pp[det][id];
1078 jacket=mScMap_j[det][id];
1083 int &det,
int &
id)
const{
1086 if(ehp<0 || det>=kFcsEHP)
return;
1087 if(ns<0 || ns>=kFcsNorthSouth)
return;
1088 if(scdep<0 || scdep>=kFcsMaxDepBd)
return;
1089 if(branch<0 || branch>=kFcsMaxBranch)
return;
1090 if(fee_i2c<0 || fee_i2c>=kFcsMaxAddr)
return;
1091 if(sipm<0 || sipm>=kFcsMaxSiPM)
return;
1092 det=mRScMap_det[ehp][ns][scdep][branch][fee_i2c][sipm];
1093 id =mRScMap_id [ehp][ns][scdep][branch][fee_i2c][sipm];
1100 if(dep<=19)
return dep%5;
1111 case 0:
case 3:
return 0 + ns*4;
1112 case 1:
case 4:
return 1 + ns*4;
1113 case 2:
case 5:
return 2 + ns*4;
1115 if(ch<8 )
return 0 + ns*4;
1116 if(ch<16)
return 1 + ns*4;
1117 if(ch<24)
return 2 + ns*4;
1119 case 8:
return 3 + ns*4;
1130 for(
int b=1; b<=8; b++){
1131 for(
int p=2; p<=7; p++){
1132 short dep = EPPMap[b-1][p-2][0];
1133 short lh = EPPMap[b-1][p-2][1];
1134 short scr = EPPMap[b-1][p-2][2];
1139 EMapSCDEP[scr-1]=dep;
1140 EMapSCBRA[scr-1]=lh;
1147 for(
int b=1; b<=4; b++){
1148 for(
int p=2; p<=7; p++){
1149 short dep = HPPMap[b-1][p-2][0];
1150 short lh = HPPMap[b-1][p-2][1];
1151 short scr = HPPMap[b-1][p-2][2];
1156 HMapSCDEP[scr-1]=dep;
1157 HMapSCBRA[scr-1]=lh;
1168 int ehp,crt,slt,dep,ch,det,id;
1169 for(
int det=0; det<kFcsNDet; det++){
1170 for(
int id=0;
id<kFcsMaxId;
id++){
1171 mMap_ehp[det][id]=-1;
1172 mMap_ch[det][id]=-1;
1173 mMap_ppb[det][id]=-1;
1174 mMap_ppp[det][id]=-1;
1175 mMap_pph[det][id]=-1;
1176 mMap_wcol[det][id]=-1;
1177 mMap_jcol[det][id]=-1;
1178 mScMap_ehp[det][id]=-1;
1179 mScMap_pp[det][id]=-1;
1180 mScMap_j[det][id]=-1;
1183 for(
int ehp=0; ehp<kFcsEHP; ehp++){
1184 for(
int ns=0; ns<kFcsNorthSouth; ns++){
1185 for(
int dep=0; dep<kFcsMaxDepBd; dep++){
1186 for(
int ch=0; ch<kFcsMaxDepCh; ch++){
1187 mRMap_det[ehp][ns][dep][ch]=6;
1188 mRMap_id[ehp][ns][dep][ch]=-1;
1190 for(
int bra=0; bra<kFcsMaxBranch; bra++){
1191 for(
int add=0; add<kFcsMaxAddr; add++){
1192 for(
int sipm=0; sipm<kFcsMaxSiPM; sipm++){
1193 mRScMap_det[ehp][ns][dep][bra][add][sipm]=-1;
1194 mRScMap_id [ehp][ns][dep][bra][add][sipm]=-1;
1204 for(
int ns=0; ns<2; ns++){
1207 for(
int row=1; row<=kFcsEcalNRow; row++){
1208 for(
int col=1; col<=kFcsEcalNCol; col++){
1209 if (row== 1){crt=1+ns*2; slt=16; dep=20; ch=col-1;}
1210 else if(row==34){crt=1+ns*2; slt=17; dep=21; ch=col-1;}
1211 else if(col== 1){crt=1+ns*2; slt=18; dep=22; ch=row-2;}
1212 else if(col==22){crt=1+ns*2; slt=19; dep=23; ch=row-2;}
1215 dep=(col-2)/4 + (row-2)/8*5;
1217 ch =(col-2)%4 + ((row-2)%8)*4;
1219 mMap_ehp[det][id] = ehp;
1220 mMap_ns [det][id] = ns;
1221 mMap_crt[det][id] = crt;
1222 mMap_slt[det][id] = slt;
1223 mMap_dep[det][id] = dep;
1224 mMap_ch [det][id] =ch ;
1225 mRMap_det[ehp][ns][dep][ch] = det;
1226 mRMap_id [ehp][ns][dep][ch] = id ;
1227 mRMap_crt[ehp][ns][dep][ch] = crt;
1228 mRMap_slt[ehp][ns][dep][ch] = slt;
1232 int b = EMapPPB[dep][lh];
1233 int p = EMapPPP[dep][lh];
1234 int h = (ch%16)/4 + (p-2)*4 + 1;
1237 mMap_ppb[det][id] = b;
1238 mMap_ppp[det][id] = p;
1239 mMap_pph[det][id] = h;
1240 mMap_wcol[det][id] = w;
1241 mMap_jcol[det][id] = j;
1245 unsigned short scdep=EMapSCDEP[scr];
1246 unsigned short bra=EMapSCBRA[scr];
1247 unsigned short pp=EMapSCPP[scr];
1248 unsigned short pj=EMapSCJ[scr];;
1249 unsigned short add=(col-1)/2;
1250 unsigned short sipm;
1252 sipm = (col-1)%2 + ((row-1)%2)*2;
1254 sipm = col%2 + ((row-1)%2)*2;
1256 mScMap_ehp[det][id] = ehp;
1257 mScMap_ns[det][id] = ns;
1258 mScMap_dep[det][id] = scdep;
1259 mScMap_bra[det][id] = bra;
1260 mScMap_add[det][id] = add;
1261 mScMap_sipm[det][id] = sipm;
1262 mScMap_pp[det][id] = pp;
1263 mScMap_j[det][id] = pj;
1264 mRScMap_det[ehp][ns][scdep][bra][add][sipm]=det;
1265 mRScMap_id[ehp][ns][scdep][bra][add][sipm]=id;
1274 for(
int ns=0; ns<2; ns++){
1278 for(
int row=1; row<=kFcsHcalNRow; row++){
1279 for(
int col=1; col<=kFcsHcalNCol; col++){
1280 if (col==13){dep=8; ch=row-1;}
1281 else if(row== 1){dep=6; ch=(col-1)%4 + ((col-1)/4)*8 ;}
1282 else if(row== 2){dep=6; ch=(col-1)%4 + ((col-1)/4)*8 + 4;}
1283 else if(row==19){dep=7; ch=(col-1)%4 + ((col-1)/4)*8 ;}
1284 else if(row==20){dep=7; ch=(col-1)%4 + ((col-1)/4)*8 + 4;}
1286 dep= (col-1)/4 + ((row-3)/8)*3;
1287 ch = (col-1)%4 + ((row-3)%8)*4;
1290 mMap_ehp[det][id] = ehp;
1291 mMap_ns [det][id] = ns;
1292 mMap_crt[det][id] = crt;
1293 mMap_slt[det][id] = slt;
1294 mMap_dep[det][id] = dep;
1295 mMap_ch[det][id] =ch ;
1296 mRMap_det[ehp][ns][dep][ch] = det;
1297 mRMap_id [ehp][ns][dep][ch] = id ;
1298 mRMap_crt[ehp][ns][dep][ch] = crt;
1299 mRMap_slt[ehp][ns][dep][ch] = slt;
1303 int b = HMapPPB[dep][lh];
1304 int p = HMapPPP[dep][lh];
1305 int h = (ch%16)/4 + (p-2)*4 + 1;
1308 mMap_ppb[det][id] = b;
1309 mMap_ppp[det][id] = p;
1310 mMap_pph[det][id] = h;
1311 mMap_wcol[det][id] = w;
1312 mMap_jcol[det][id] = j;
1315 unsigned short feerow = (row-1)/2;
1316 unsigned short scdep=HMapSCDEP[feerow];
1317 unsigned short bra=HMapSCBRA[feerow];
1318 unsigned short pp=HMapSCPP[feerow];
1319 unsigned short pj=HMapSCJ[feerow];
1320 unsigned short add=col-1;
1321 unsigned short sipm;
1327 mScMap_ehp[det][id] = ehp;
1328 mScMap_ns[det][id] = ns;
1329 mScMap_dep[det][id] = scdep;
1330 mScMap_bra[det][id] = bra;
1331 mScMap_add[det][id] = add;
1332 mScMap_pp[det][id] = pp;
1333 mScMap_j[det][id] = pj;
1334 mScMap_sipm[det][id] = sipm;
1335 mRScMap_det[ehp][ns][scdep][bra][add][sipm]=det;
1336 mRScMap_id[ehp][ns][scdep][bra][add][sipm]=id;
1346 for(
int ns=0; ns<2; ns++){
1349 for(
int dep=0; dep<6; dep++){
1350 for(
int ch=0; ch<32; ch++){
1353 mMap_ehp[det][id] = ehp;
1354 mMap_ns [det][id] = ns;
1355 mMap_crt[det][id] = crt;
1356 mMap_slt[det][id] = slt;
1357 mMap_dep[det][id] = dep;
1358 mMap_ch[det][id] = ch ;
1359 mRMap_det[ehp][ns][dep][ch] = det;
1360 mRMap_id [ehp][ns][dep][ch] = id ;
1361 mRMap_crt[ehp][ns][dep][ch] = crt;
1362 mRMap_slt[ehp][ns][dep][ch] = slt;
1369 int ehp,crt,slt,dep,ch,det,id,ns;
1374 for(
int det=0; det<kFcsNDet; det++){
1375 for(
int id=0;
id<kFcsMaxId;
id++){
1376 mMap_ehp[det][id]=-1;
1377 mMap_ns[det][id]=-1;
1378 mMap_crt[det][id]=-1;
1379 mMap_slt[det][id]=-1;
1380 mMap_dep[det][id]=-1;
1381 mMap_ch[det][id]=-1;
1384 for(
int ehp=0; ehp<kFcsEHP; ehp++){
1385 for(
int ns=0; ns<kFcsNorthSouth; ns++){
1386 for(
int dep=0; dep<kFcsMaxDepBd; dep++){
1387 for(
int ch=0; ch<kFcsMaxDepCh; ch++){
1388 mRMap_det[ehp][ns][dep][ch]=6;
1389 mRMap_id[ehp][ns][dep][ch]=-1;
1390 mRMap_crt[ehp][ns][dep][ch]=-1;
1391 mRMap_slt[ehp][ns][dep][ch]=-1;
1403 for(
int row=1; row<=8; row++){
1404 for(
int col=1; col<=8; col++){
1407 mMap_ehp[det][id] = ehp;
1408 mMap_ns [det][id] = ns;
1409 mMap_crt[det][id] = crt;
1410 mMap_slt[det][id] = slt;
1411 mMap_dep[det][id] = dep;
1412 mMap_ch [det][id] = c[dep] ;
1414 mRMap_det[ehp][ns][dep][c[dep]] = det;
1415 mRMap_id [ehp][ns][dep][c[dep]] = id ;
1416 mRMap_crt[ehp][ns][dep][c[dep]] = crt;
1417 mRMap_slt[ehp][ns][dep][c[dep]] = slt;
1429 for(
int row=1; row<=4; row++){
1430 for(
int col=1; col<=4; col++){
1431 mMap_ehp[det][id] = ehp;
1432 mMap_ns [det][id] = ns;
1433 mMap_crt[det][id] = crt;
1434 mMap_slt[det][id] = slt;
1435 mMap_dep[det][id] = dep;
1436 mMap_ch[det][id] =ch ;
1437 mRMap_det[ehp][ns][dep][ch] = det;
1438 mRMap_id [ehp][ns][dep][ch] = id ;
1439 mRMap_crt[ehp][ns][dep][ch] = crt;
1440 mRMap_slt[ehp][ns][dep][ch] = slt;
1452 for(
int id=0;
id<9;
id++){
1453 mMap_ehp[det][id] = ehp;
1454 mMap_ns [det][id] = ns;
1455 mMap_crt[det][id] = crt;
1456 mMap_slt[det][id] = slt;
1457 mMap_dep[det][id] = dep;
1458 mMap_ch[det][id] = ch ;
1459 mRMap_det[ehp][ns][dep][ch] = det;
1460 mRMap_id [ehp][ns][dep][ch] = id ;
1461 mRMap_crt[ehp][ns][dep][ch] = crt;
1462 mRMap_slt[ehp][ns][dep][ch] = slt;
1471 if(tt<0 || tt>=32)
return;
1474 row=(pp-1)*2 + (tt+1)%2 + 1;
1476 }
else if(pp>=7 && pp<=12){
1478 row=(12-pp)*2 + (tt)%2 + 1;
1481 id=(row-1)*16 + col;
1489 tt = (col-1)*2 - (row-1)%2 + 1;
1491 pp = 12 - (row-1)/2;
1492 tt = (col-1)*2 + (row-1)%2;
1497 fprintf(f,
"### Detector\n");
1498 fprintf(f,
"#det : 0/1=ECal-N/S 2/3=Hcal-N/S 4/5=PRS-N/S\n");
1499 fprintf(f,
"#id : 0~747 for Ecal 0~259 for Hcal\n");
1500 fprintf(f,
"#row : 1~34 for Ecal 1~20 for Hcal\n");
1501 fprintf(f,
"#col : 1~22 for Ecal 1~13 for Hcal\n");
1502 fprintf(f,
"### Readout\n");
1503 fprintf(f,
"#ehp : 0=ECal 1=Hcal 2=PRS\n");
1504 fprintf(f,
"#ns : 0=north 1=south\n");
1505 fprintf(f,
"#crt : 0=EcalNorth 1=MixNorth 2=Main 3=MixSouth 4=EcalSouth\n");
1506 fprintf(f,
"#slt : 0~19\n");
1507 fprintf(f,
"#dep : 0~24 for Ecal 0~7 for Hcal 0~3 for Pres\n");
1508 fprintf(f,
"#ch : 0~31 for all DEP\n");
1509 fprintf(f,
"### Patchpanel and cable\n");
1510 fprintf(f,
"#FRow: FEEBd Row = (row-1)/2 [0-16 for Ecal 0-9 for Hcal]\n");
1511 fprintf(f,
"#FCol: FEEBd Col = FEEBd Addr [0-10 for Ecal 0-12 for Hcal]\n");
1512 fprintf(f,
"#SiPM: FEEBd Ch# [0-3 for Ecal 0-1 for Hcal]\n");
1513 fprintf(f,
"#ppb : PatchPanel Board# [1~8 for Ecal 1-4 for Hcal]\n");
1514 fprintf(f,
"#ppp : PatchPanel MDR cable P# [2-7]\n");
1515 fprintf(f,
"#pph : PatchPanel Header# [1-24]\n");
1516 fprintf(f,
"#jcol: Cable Jacket color\n");
1517 fprintf(f,
"#wcol: Cable Wire color\n");
1518 fprintf(f,
"#length: Cable length\n");
1521 fprintf(f,
"#det id row col ehp ns crt slt dep ch Frow Fcol SiPM ppb ppp pph jcol wcol length\n");
1523 fprintf(f,
"#ehp ns dep ch crt slt det id row col Frow Fcol SiPM ppb ppp pph jcol wcol length\n");
1527 fprintf(f,
"#det,id,row,col,ehp,ns,crt,slt,dep,ch,Frow,Fcol,SiPM,ppb,ppp,pph,jcol,wcol,length\n");
1529 fprintf(f,
"#ehp,ns,dep,ch,crt,slt,det,id,row,col,Frow,Fcol,SiPM,ppb,ppp,pph,jcol,wcol,length\n");
1535 fprintf(f,
"# Css-DDch\n");
1536 fprintf(f,
"# C : crate 0~4 for EcalN,MixN,Main,MixS,EcalS\n");
1537 fprintf(f,
"# ss : slot (0~19)\n");
1538 fprintf(f,
"# DD : DEP bd# (0~24 for Ecal, 0~7 for Hcal\n");
1539 fprintf(f,
"# ch : DEP ch# (0~31 for all DEP)\n");
1543 fprintf(f,
"# crt-slt : ns ehp dep : DNiii-RR/CC DNiii-RR/CC DNiii-RR/CC ...\n");
1544 fprintf(f,
"# D : \"E\"cal, \"H\"cal, \"P\"res\n");
1545 fprintf(f,
"# N : North or South\n");
1546 fprintf(f,
"# iii : id\n");
1547 fprintf(f,
"# RR : Row\n");
1548 fprintf(f,
"# CC : Column\n");
1552 fprintf(f,
"### Detector\n");
1553 fprintf(f,
"#det : 0/1=ECal N/S, 2/3=Hcal N/S , 4/5=PRS N/S\n");
1554 fprintf(f,
"#id : 0~747 for Ecal, 0~259 for Hcal\n");
1555 fprintf(f,
"#row : 1~34 for Ecal, 1~20 for Hcal\n");
1556 fprintf(f,
"#col : 1~22 for Ecal, 1~13 for Hcal\n");
1557 fprintf(f,
"### Slow Control\n");
1558 fprintf(f,
"#ehp : 0=ECal, 1=Hcal, 2=PRS\n");
1559 fprintf(f,
"#ns : 0=north, 1=south\n");
1560 fprintf(f,
"#dep : 0~24 for Ecal, 0~7 for Hcal, 0~3 for Pres\n");
1561 fprintf(f,
"#branch : 0~1\n");
1562 fprintf(f,
"#switch addr: 0~15\n");
1563 fprintf(f,
"#SiPM# : 0~3 for Ecal, 0~1 for Hcal&Pres\n");
1564 fprintf(f,
"### Patchpanel and cable\n");
1565 fprintf(f,
"#ppb : PatchPanel Board# (1~8 for ecal, 1-4 for hcal)\n");
1566 fprintf(f,
"#J : PatchPanel SC conection (J1~J3)\n");
1568 fprintf(f,
"#det id row col ehp ns dep bra add SiPM ppb J\n");
1570 fprintf(f,
"#ehp ns dep bra add SiPM det id row col\n");
1575 int ehp,ns,crt,slt,dep,ch,det,id,row,col=0;
1577 FILE *f1 = fopen(
"fcsMap.txt",
"w");
printHeader(f1);
1578 FILE *f1c = fopen(
"fcsMap.csv",
"w");
printHeader(f1c,0,1);
1579 FILE *f1e = fopen(
"fcs_ecal_readout_map.csv",
"w");
printHeader(f1e);
1580 FILE *f1h = fopen(
"fcs_hcal_readout_map.csv",
"w");
printHeader(f1h);
1581 FILE *f1p = fopen(
"fcs_pres_readout_map.csv",
"w");
printHeader(f1p);
1583 FILE *f3 = fopen(
"fcsDepMap.txt",
"w");
printHeader(f3,1);
1584 FILE *f3c= fopen(
"fcsDepMap.csv",
"w");
printHeader(f3c,1,1);
1585 FILE *f4 = fopen(
"fcsDepMap2.txt",
"w");
printHeader3(f4);
1586 FILE *f5 = fopen(
"fcsScMap.txt",
"w");
printHeader4(f5);
1587 FILE *f5e = fopen(
"fcs_ecal_sc_map.csv",
"w");
printHeader4(f5e);
1588 FILE *f5h = fopen(
"fcs_hcal_sc_map.csv",
"w");
printHeader4(f5h);
1589 FILE *f5p = fopen(
"fcs_pres_sc_map.csv",
"w");
printHeader4(f5p);
1590 FILE *f6 = fopen(
"fcsScRevMap.txt",
"w");
printHeader4(f6,1);
1592 FILE *f7 = fopen(
"fcsEpdMap.txt",
"w");
1593 FILE *fpp = fopen(
"fcsPPMap.txt",
"w");
1596 for(ns=0; ns<2; ns++){
1599 fprintf(f2,
"Ecal NS=%1d\n",ns);
1600 for(row=1; row<=
nRow(det); row++){
1601 for(col=1; col<=
nColumn(det); col++){
1602 if(mMap_ehp[det][
id]>=0){
1603 fprintf(f1,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %2d %2d %2d %2d P%1d H%02d %6s %6s %3.1f\n",
1612 mScMap_add[det][
id],
1613 mScMap_sipm[det][
id],
1617 colJ[mMap_jcol[det][
id]],
1618 colW[mMap_wcol[det][
id]],
1619 leng[mMap_jcol[det][
id]]);
1620 fprintf(f1c,
"%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%2d,%2d,%2d,%2d,P%1d,H%02d,%6s,%6s,%3.1f\n",
1629 mScMap_add[det][
id],
1630 mScMap_sipm[det][
id],
1634 colJ[mMap_jcol[det][
id]],
1635 colW[mMap_wcol[det][
id]],
1636 leng[mMap_jcol[det][
id]]);
1637 fprintf(f1e,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1645 fprintf(f2,
"%1d%02d-%02d%02d ",
1646 mMap_crt[det][
id],mMap_slt[det][
id],
1647 mMap_dep[det][
id],mMap_ch[det][
id]);
1649 if(mScMap_ehp[det][
id]>=0){
1650 fprintf(f5,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %2d J%1d\n",
1652 mScMap_ehp[det][
id],
1653 mScMap_ns [det][
id],
1654 mScMap_dep[det][
id],
1655 mScMap_bra[det][
id],
1656 mScMap_add[det][
id],
1657 mScMap_sipm[det][
id],
1660 fprintf(f5e,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1662 mScMap_ehp[det][
id],
1663 mScMap_ns [det][
id],
1664 mScMap_dep[det][
id],
1665 mScMap_bra[det][
id],
1666 mScMap_add[det][
id],
1667 mScMap_sipm[det][
id]);
1676 for(
int ns=0; ns<2; ns++){
1679 fprintf(f2,
"Hcal NS=%1d\n",ns);
1680 for(row=1; row<=
nRow(det); row++){
1681 for(col=1; col<=
nColumn(det); col++){
1682 if(mMap_ehp[det][
id]>=0){
1683 fprintf(f1,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %2d %2d %2d %2d P%1d H%02d %6s %6s %3.1f\n",
1692 mScMap_add[det][
id],
1693 mScMap_sipm[det][
id],
1697 colJH[mMap_jcol[det][
id]],
1698 colW[mMap_wcol[det][
id]],
1699 lengH[mMap_jcol[det][
id]]);
1700 fprintf(f1c,
"%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%2d,%2d,%2d,%2d,P%1d,H%02d,%6s,%6s,%3.1f\n",
1709 mScMap_add[det][
id],
1710 mScMap_sipm[det][
id],
1714 colJH[mMap_jcol[det][
id]],
1715 colW[mMap_wcol[det][
id]],
1716 lengH[mMap_jcol[det][
id]]);
1717 fprintf(f1h,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1725 fprintf(f2,
"%1d%02d-%02d%02d ",
1726 mMap_crt[det][
id],mMap_slt[det][
id],
1727 mMap_dep[det][
id],mMap_ch[det][
id]);
1729 if(mScMap_ehp[det][
id]>=0){
1730 fprintf(f5,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %2d J%1d\n",
1732 mScMap_ehp[det][
id],
1733 mScMap_ns [det][
id],
1734 mScMap_dep[det][
id],
1735 mScMap_bra[det][
id],
1736 mScMap_add[det][
id],
1737 mScMap_sipm[det][
id],
1740 fprintf(f5h,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1742 mScMap_ehp[det][
id],
1743 mScMap_ns [det][
id],
1744 mScMap_dep[det][
id],
1745 mScMap_bra[det][
id],
1746 mScMap_add[det][
id],
1747 mScMap_sipm[det][
id]);
1756 for(
int ns=0; ns<2; ns++){
1759 fprintf(f2,
"PRS NS=%1d\n",ns);
1760 for(row=1; row<=
nRow(det); row++){
1761 for(col=1; col<=
nColumn(det); col++){
1762 if(mMap_ehp[det][
id]>=0){
1763 fprintf(f1,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %2d %2d %2d %2d P%1d H%02d %6s %6s %3.1f\n",
1771 0,0,0,0,0,0,
"x",
"x",0.0);
1772 fprintf(f1c,
"%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%3d,%2d,%2d,%2d,%2d,P%1d,H%02d,%6s,%6s,%3.1f\n",
1780 0,0,0,0,0,0,
"x",
"x",0.0);
1781 fprintf(f1p,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1789 fprintf(f2,
"%1d%02d-%02d%02d ",
1790 mMap_crt[det][
id],mMap_slt[det][
id],
1791 mMap_dep[det][
id],mMap_ch[det][
id]);
1793 if(mScMap_ehp[det][
id]>=0){
1794 fprintf(f5,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1796 mScMap_ehp[det][
id],
1797 mScMap_ns [det][
id],
1798 mScMap_dep[det][
id],
1799 mScMap_bra[det][
id],
1800 mScMap_add[det][
id],
1801 mScMap_sipm[det][
id]);
1802 fprintf(f5p,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1804 mScMap_ehp[det][
id],
1805 mScMap_ns [det][
id],
1806 mScMap_dep[det][
id],
1807 mScMap_bra[det][
id],
1808 mScMap_add[det][
id],
1809 mScMap_sipm[det][
id]);
1818 for(ehp=0; ehp<kFcsEHP; ehp++){
1819 for(ns=0; ns<2; ns++){
1820 for(dep=0; dep<kFcsMaxDepBd; dep++){
1821 if(ehp==1 && dep>8)
break;
1822 if(ehp==2 && dep>3)
break;
1824 for(ch=0; ch<kFcsMaxDepCh; ch++){
1825 if(mRMap_det[ehp][ns][dep][ch]<0){
1826 if(flag==1 && ch%8==7) fprintf(f4,
"\n");
1830 det = mRMap_det[ehp][ns][dep][ch];
1831 id = mRMap_id[ehp][ns][dep][ch];
1832 crt=mRMap_crt[ehp][ns][dep][ch];
1833 slt=mRMap_slt[ehp][ns][dep][ch];
1835 fprintf(f4,
"%2s%2d : NS=%1d %1d(%4s) DEP%02d : ",CRT[crt],slt,ns,ehp,EHP[ehp],dep);
1839 if(det>=0 && det<kFcsNDet){
1843 const char* colj;
float len;
1844 if(ehp==0) { colj=colJ[mMap_jcol[det][id]]; len=leng[mMap_jcol[det][id]]; }
1845 else { colj=colJH[mMap_jcol[det][id]]; len=lengH[mMap_jcol[det][id]];}
1846 fprintf(f3,
"%3d %3d %3d %3d %2s %2d %3d %3d %3d %3d %2d %2d %2d %2d P%1d H%02d %6s %6s %3.1f\n",
1851 mScMap_add[det][
id],
1852 mScMap_sipm[det][
id],
1857 colW[mMap_wcol[det][
id]],
1859 fprintf(f3c,
"%3d,%3d,%3d,%3d,%2s,%2d,%3d,%3d,%3d,%3d,%2d,%2d,%2d,%2d,P%1d,H%02d,%6s,%6s,%3.1f\n",
1864 mScMap_add[det][
id],
1865 mScMap_sipm[det][
id],
1870 colW[mMap_wcol[det][
id]],
1873 fprintf(f3,
"%3d %3d %3d %3d %2s %2d %3d %3d %3d %3d\n",
1877 fprintf(f3c,
"%3d,%3d,%3d,%3d,%2s,%2d,%3d,%3d,%3d,%3d\n",
1883 fprintf(f4,
"%2s%03d-%02d/%02d ",DET[det],
id,row,col);
1884 if(ch%8==7) fprintf(f4,
"\n");
1891 for(ehp=0; ehp<kFcsEHP; ehp++){
1892 for(ns=0; ns<2; ns++){
1893 for(dep=0; dep<kFcsMaxDepBd; dep++){
1894 if(ehp==1 && dep>8)
break;
1895 if(ehp==2 && dep>3)
break;
1896 for(
int bra=0; bra<kFcsMaxBranch; bra++){
1897 for(
int add=0; add<kFcsMaxAddr; add++){
1898 for(
int sipm=0; sipm<kFcsMaxSiPM; sipm++){
1899 if(mRScMap_det[ehp][ns][dep][bra][add][sipm]>=0){
1900 int det=mRScMap_det[ehp][ns][dep][bra][add][sipm];
1901 int id =mRScMap_id[ehp][ns][dep][bra][add][sipm];
1904 fprintf(f6,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1905 ehp,ns,dep,bra,add,sipm,
1916 fprintf(f7,
"#ehp ns crt slt dep ch det id row col pp tt Reversed(det id r c)\n");
1917 for(
int det=4; det<=5; det++){
1918 for(
int r=1; r<=
nRow(det); r++){
1919 for(
int c=1; c<=
nColumn(det); c++){
1920 int id =
getId(det,r,c);
1921 int ehp,ns,crt,slt,dep,ch,det2,id2,r2,c2,pp,tt;
1927 fprintf(f7,
"%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %3d\n",
1928 ehp,ns,crt,slt,dep,ch,
1936 for(
int ehp=0; ehp<2; ehp++){
1937 for(
int ns=0; ns<2; ns++){
1938 if(ehp==0 && ns==1)
continue;
1940 if(ehp==0) {bmax=8; fprintf(fpp,
"Ecal\n");}
1941 if(ehp==1 && ns==0) {bmax=4; fprintf(fpp,
"Hcal North\n");}
1942 if(ehp==1 && ns==1) {bmax=4; fprintf(fpp,
"Hcal South\n");}
1943 fprintf(fpp,
"PPB# P# DEP Ch T Pwr/ctrl Row#\n");
1944 for(
int b=1; b<=bmax; b++){
1945 for(
int p=2; p<=7; p++){
1948 dep = EPPMap[b-1][p-2][0];
1949 lh = EPPMap[b-1][p-2][1];
1950 scr = EPPMap[b-1][p-2][2];
1952 dep = HPPMap[b-1][p-2][0];
1953 lh = HPPMap[b-1][p-2][1];
1954 scr = HPPMap[b-1][p-2][2];
1956 fprintf(fpp,
"%2d %2d ",b,p);
1958 fprintf(fpp,
"%2d %02d-%02d ",dep,lh*16,lh*16+15);
1959 for(
int i=0; i<4; i++){
1961 int ch = lh*16 + i*4;
1962 int det = mRMap_det[ehp][ns][dep][ch];
1963 int id = mRMap_id[ehp][ns][dep][ch];
1968 fprintf(fpp,
"T%02d=R%02d-%6s ",t,row,colJ[col]);
1970 fprintf(fpp,
"T%02d=R%02d-%6s ",t,row,colJH[col]);
1973 fprintf(fpp,
"T%02d= ",t);
1980 fprintf(fpp,
"J%1d ",p/2);
1981 if(scr>0) fprintf(fpp,
"%2d,%2d",scr*2-1,scr*2);
1982 else if(scr==-2) fprintf(fpp,
"no power");
1983 else fprintf(fpp,
"-");
2010 float StFcsDb::getEtGain(
int det,
int id,
float factor)
const{
2011 if(det<0 || det>=kFcsNDet)
return 0.0;
2012 if(id<0 || id>=kFcsMaxId)
return 0.0;
2013 return (mEtGain[det][
id]-1.0)*factor+1.0;
2018 double norm[2]={0.24711, 0.24711};
2019 double xoff[2]={6.570*2.54 - 6.850*2.54, 7.430*2.54-8.380*2.54};
2020 double yoff[2]={-5.26,1.80};
2026 for(
int det=0; det<kFcsNDet; det++){
2029 for(
int i=0; i<
maxId(det); i++){
2033 if(mEtGainMode==1) {
2034 if(ns==0) xyz.setX(xyz.x()-xoff[eh]);
2035 else xyz.setX(xyz.x()+xoff[eh]);
2036 xyz.setY(xyz.y()+yoff[eh]);
2038 double r=xyz.perp();
2040 double ptch=gain/l*r;
2041 ratio=ptch/norm[eh]*1000;
2045 mEtGain[det][i]=ratio;
2048 if(mDebug==0)
return;
2050 FILE *f1 = fopen(
"fcsPtGain.txt",
"w");
2051 FILE *f2 = fopen(
"fcsPtGain2.txt",
"w");
2052 FILE *f3 = fopen(
"fcsPtGain3.txt",
"w");
2053 FILE *f4 = fopen(
"fcs_ecal_phys_gains.txt",
"w");
2054 FILE *f5 = fopen(
"fcs_hcal_phys_gains.txt",
"w");
2055 FILE *f6 = fopen(
"fcs_ecal_calib_gains.txt",
"w");
2056 FILE *f7 = fopen(
"fcs_hcal_calib_gains.txt",
"w");
2057 fprintf(f4,
"#ehp ns dep ch EtGain\n");
2058 fprintf(f5,
"#ehp ns dep ch EtGain\n");
2059 fprintf(f6,
"#ehp ns dep ch CalibGain\n");
2060 fprintf(f7,
"#ehp ns dep ch CalibGain\n");
2061 for(
int det=0; det<kFcsNDet; det++){
2065 fprintf(f2,
"DET=%1d ET/ch [unit = MeV/count]\n", det);
2066 fprintf(f3,
"DET=%1d normalized ET/ch [unit=%f MeV/count]\n", det,norm[eh]);
2067 for(
int row=1; row<=
nRow(det); row++){
2068 for(
int col=1; col<=
nColumn(det); col++){
2070 double r=xyz.perp();
2075 double ptch=gain/l*r;
2077 if(eh<2) ratio=ptch/norm[eh]*1000;
2078 fprintf(f1,
"D=%1d Id=%3d Row=%2d Column=%2d xyz=%7.2f %7.2f %7.2f Gain=%7.5f ET/ch=%6.4f [MeV/count] norm=%6.4f\n",
2079 det,
id,row,col,x,y,z,gain,ptch*1000,ratio);
2080 fprintf(f2,
"%7.5f ", ptch*1000);
2081 fprintf(f3,
"%7.5f ", ratio);
2088 for(
int ehp=0; ehp<2; ehp++){
2089 for(
int ns=0; ns<2; ns++){
2090 for(
int dep=0; dep<
getNDep(ehp,ns); dep++){
2091 for(
int ch=0; ch<kFcsMaxDepCh; ch++){
2094 float ratio = mEtGain[det][id];
2095 float calib = (ratio-1.0)/2.0+1.0;
2097 fprintf(f4,
"%3d %3d %3d %3d %8.4f\n",ehp,ns,dep,ch,ratio);
2098 fprintf(f6,
"%3d %3d %3d %3d %8.4f\n",ehp,ns,dep,ch,calib);
2100 fprintf(f5,
"%3d %3d %3d %3d %8.4f\n",ehp,ns,dep,ch,ratio);
2101 fprintf(f7,
"%3d %3d %3d %3d %8.4f\n",ehp,ns,dep,ch,calib);
2117 return mPed[ehp][ns][dep][ch];
2121 mPed[ehp][ns][dep][ch]=ped;
2125 memset(mPed,0,
sizeof(mPed));
2126 LOG_INFO << Form(
"Reading Pedestal from %s",file)<<endm;
2127 FILE* F=fopen(file,
"r");
2129 LOG_ERROR << Form(
"Could not open %s",file)<<endm;
2134 while(fscanf(F,
"%d %d %d %d %f %f",&ehp,&ns,&dep,&ch,&mean,&rms) != EOF){
2135 mPed[ehp][ns][dep][ch]=mean;
2136 LOG_INFO << Form(
"PED %1d %1d %2d %2d %f %f",ehp,ns,dep,ch,mPed[ehp][ns][dep][ch],rms)<<endm;
2141 void StFcsDb::readGainFromText(){
2142 memset(mGain,0,
sizeof(mGain));
2143 LOG_INFO << Form(
"Reading Gain from %s",mGainFilename)<<endm;
2144 FILE* F=fopen(mGainFilename,
"r");
2146 LOG_ERROR << Form(
"Could not open %s",mGainFilename)<<endm;
2151 while(fscanf(F,
"%d %d %d %d %f",&ehp,&ns,&dep,&ch,&gain) != EOF){
2152 mGain[ehp][ns][dep][ch]=gain;
2153 LOG_INFO<<Form(
"GAIN %1d %1d %2d %2d %f",ehp,ns,dep,ch,mGain[ehp][ns][dep][ch])<<endm;
2158 void StFcsDb::readGainCorrFromText(){
2159 memset(mGainCorr,0,
sizeof(mGainCorr));
2160 LOG_INFO << Form(
"Reading GainCorr from %s",mGainCorrFilename)<<endm;
2161 FILE* F=fopen(mGainCorrFilename,
"r");
2163 LOG_ERROR << Form(
"Could not open %s",mGainCorrFilename)<<endm;
2168 while(fscanf(F,
"%d %d %d %d %f",&ehp,&ns,&dep,&ch,&gain) != EOF){
2169 mGainCorr[ehp][ns][dep][ch]=gain;
2170 LOG_INFO<<Form(
"GAIN CORR %1d %1d %2d %2d %f",ehp,ns,dep,ch,mGainCorr[ehp][ns][dep][ch])<<endm;
2178 while(g2ttrk[i].next_parent_p !=0){
2180 LOG_INFO<<Form(
" BackTrace from=%3d id=%3d Epid=%4d Gpid=%3d Vtx=%3d Parent=%3d E=%6.2f",
2181 id,g2ttrk[i].
id,g2ttrk[i].eg_pid,g2ttrk[i].ge_pid,g2ttrk[i].start_vertex_p,
2182 g2ttrk[i].next_parent_p,g2ttrk[i].e)<<endm;
2183 i = g2ttrk[i].next_parent_p - 1;
2185 if(mDebug>3) LOG_INFO<<Form(
" BackTrace from=%3d id=%3d Epid=%4d Gpid=%3d Vtx=%3d Parent=%3d E=%6.2f Primary!!",
2186 id,g2ttrk[i].
id,g2ttrk[i].eg_pid,g2ttrk[i].ge_pid,g2ttrk[i].start_vertex_p,
2187 g2ttrk[i].next_parent_p,g2ttrk[i].e)<<endm;
2193 c.hits().push_back(h);
2194 return getG2tTrack(&c,g2ttrk,fraction,ntrk,order,0);
2197 const g2t_track_st* StFcsDb::getPrimaryG2tTrack(
StFcsHit* h, g2t_track_st* g2ttrk,
float& fraction,
int& ntrk,
unsigned int order){
2199 c.hits().push_back(h);
2200 return getG2tTrack(&c,g2ttrk,fraction,ntrk,order,1);
2204 return getG2tTrack(c,g2ttrk,fraction,ntrk,order,0);
2207 const g2t_track_st* StFcsDb::getPrimaryG2tTrack(
StFcsCluster* c, g2t_track_st* g2ttrk,
float& fraction,
int& ntrk,
unsigned int order){
2208 return getG2tTrack(c,g2ttrk,fraction,ntrk,order,1);
2211 const g2t_track_st* StFcsDb::getG2tTrack(
StFcsCluster* c, g2t_track_st* g2ttrk,
float& fraction,
int& ntrk,
unsigned int order,
int mode){
2213 vector<pair<unsigned int, float>> parents;
2215 for(
const pair<unsigned int, float> & gt :
hit->getGeantTracks()){
2218 case 0:
id=gt.first;
break;
2223 for(pair<unsigned int, float>& p : parents){
2224 if(p.first ==
id) {p.second += de; found=1;
break;}
2226 if(found==0) parents.push_back(make_pair(
id,de));
2230 ntrk=parents.size();
2231 if(order >= ntrk) {fraction=0;
return 0;}
2232 std::nth_element(parents.begin(), parents.begin()+order, parents.end(),
2233 [](
const pair<unsigned int,float>&a,
const pair<unsigned int,float>&b){
2234 return b.second < a.second;
2236 fraction = parents[order].second / detot;
2238 for(
unsigned int jtrk=0; jtrk<ntrk; jtrk++){
2239 LOG_INFO << Form(
"Cluster's G2T Track %3d mode=%1d id=%3d dE=%f",jtrk,mode,parents[jtrk].first,parents[jtrk].second)<<endm;
2242 return &g2ttrk[parents[order].first-1];
float getGainOnline(int det, int id) const
get the pres valley position for cut
int getColumnNumber(int det, int id) const
get the row number for the channel
void setPedestal(int ehp, int ns, int dep, int ch, float ped)
get Pedestal
void printHeader3(FILE *f)
Map header.
void setFcsEcalGainOnline(fcsEcalGainOnline_st *)
set fcsPresValley_st*
void makePPMap()
Generate maps (this is the origin of the map)
void makeMap2019()
cable jacket color
void getIdfromEPD(int pp, int tt, int &det, int &id)
Map header.
void printHeader(FILE *f, int flag, int csv)
Print maps.
float pedestal(int ehp, int ns, int dep, int ch)
Get EPD's EPD map from FCS mapping.
StLorentzVectorD getLorentzVector(const StThreeVectorD &xyz, float energy, float zVertex=0.0)
Get get 4 vector assuing m=0 and taking beamline from DB.
int getZeroSuppression(int det) const
fcsGain/GainCorrection related
float getGainCorrection(int det, int id) const
get the gain for the channel for 8 timebin sum
void setFcsPresGain(fcsPresGain_st *)
set fcsHcalGain_st*
int getRowNumber(int det, int id) const
maximum number of id
float getEta(int det, float FcsX, float FcsY, float FcsZ=-1.0, float zVertex=0.0) const
get the STAR frame pseudo rapidity from the vertex from local X/Y [cm]
int jacketColor(int ehp, int ns, int dep, int ch)
Generate Patchpanel map.
static int getDetFromName(const std::string &detname)
Get det/id from name.
float getPhi(int det, float FcsX, float FcsY, float FcsZ=-1.0) const
get the STAR frame phi angle from from local X/Y [cm]
void setFcsPresValley(fcsPresValley_st *)
set fcsHcalGainCorr_st*
void setFcsHcalGain(fcsHcalGain_st *)
set fcsEcalGain_st*
StThreeVectorD projectLine(int det, StThreeVectorD &linedirection, StThreeVectorD &lineorigin, double showermaxz=-1) const
Like #projectLine(det, double*, double*, double) except use StThreeVectorD for line direction and ori...
int northSouth(int det) const
Ecal=0, Hcal=1, Pres=2.
void getName(int det, int id, char name[])
get the DEP/ch id
void setLeakyHcal(int v=1)
set run19 geometry, otherwise final run21
StThreeVectorD getDetectorOffset(int det, double zdepth=-1) const
Utility functions related to DetectorPosition.
int detectorId(int eh, int ns) const
6
double getHcalProjectedToEcalX(int ns, double hcalLocalX, double zvtx=0.0)
Project Hcal local X to Ecal local X [cm].
const g2t_track_st * getParentG2tTrack(StFcsHit *h, g2t_track_st *g2ttrk, float &fraction, int &ntrk, unsigned int order=0)
float getSamplingFraction(int det) const
get zero suppression threshold
StThreeVectorD getStarXYZfromColumnRow(int det, float col, float row, float FcsZ=-1.0) const
get the STAR frame cooridnates from other way
void readPedFromText(const char *file="fcsped.txt")
setting pedestal
void getIdfromDep(int ehp, int ns, int dep, int ch, int &detectorId, int &id, int &crt, int &slt) const
Get DEP map.
void setRun19(int v=1)
set run#
StThreeVectorD projectTrackToEcal(const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
project a g2t track to Ecal with a given track and vertex. If no vertex given assume a vertex of (0...
float getPresThreshold(int det, int id) const
get the gain correction for the channel
float getZDepth(int det) const
get the Y width of the cell
void printHeader4(FILE *f, int flag)
Map header.
float getXWidth(int det) const
get the angle of the detector
float getGain8(int det, int id) const
get the gain for the channel for 16 timebin sum
void setFcsHcalGainOnline(fcsHcalGainOnline_st *)
set fcsEcalGainOnline_st*
void setFcsEcalGainCorr(fcsEcalGainCorr_st *)
set fcsPresGain_st*
void getLocalXYinCell(StFcsHit *hit, float &x, float &y) const
getting XY in local cell coordinate
StThreeVectorD getStarXYZ(int det, float FcsX, float FcsY, float FcsZ=-1.0, float zVertex=0.0) const
get the STAR frame cooridnates from local XYZ [cm]
void setRun(int run)
enable(1) or disable(0) offline DB access
void setFcsEcalGain(fcsEcalGain_st *)
set fcsDetectorPosition_st*
void getEPDfromId(int det, int id, int &pp, int &tt)
Get FCS's EPD map foom EPD mapping.
int ecalHcalPres(int det) const
Ecal North=0, Ecal South=1, Hcal North=2, Hcal South=3, Pres=4/5.
float getGain(int det, int id) const
get sampling fraction
int maxDetectorId() const
set fcsPresThreshold_st*
void setDbAccess(int v=1)
debug level
StThreeVectorD projectTrackToEcalSMax(const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
SMax = Shower Max Z.
static unsigned short getKey(unsigned short detid, unsigned short id)
Get det from name.
float getPresValley(int det, int id) const
get the gain correction for the channel
float getDetectorAngle(int det) const
This is the vector normal to the detector plane.
void printHeader2(FILE *f)
Map header.
int getNDep(int ehp, int ns) const
Get Det map.
void printMap()
Generate map for run19.
int getDepCh(int dep, int ch) const
get the id from row/col
StThreeVectorD projectTrack(int det, const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert, double showermaxz=-1) const
Generic g2t track projection function but #det and #showermaxz needs to be specified; if #det or #sho...
int maxId(int det) const
number of column
void makeMap()
Get Id from SC.
void getIdfromSCmap(int ehp, int ns, int scdep, int branch, int fee_i2c, int sipm, int &det, int &id) const
Get SC map.
void getSCmap(int det, int id, int &ehp, int &ns, int &scdep, int &branch, int &fee_i2c, int &sipm, int &pp, int &jacket) const
of DEP
int getId(int det, int row, int col) const
get the column number for the channel
int nRow(int det) const
north or south side
StThreeVectorD projectTrackToHcal(const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
project a g2t track to Hcal with a given track and vertex. If no vertex given assume a vertex of (0...
void setFcsPresThreshold(fcsPresThreshold_st *)
set fcsHcalGainOnline_st*
void setFcsDetectorPosition(fcsDetectorPosition_st *t)
set Et Gain Setting 0=Auto from run#, 1=Old, 2=New(23027048)
int nColumn(int det) const
number of rows
unsigned int backTraceG2tTrack(unsigned int id, g2t_track_st *g2ttrk)
reading pedestal from text
static void getFromName(const char name[], int &det, int &id)
Get Name of a channel.
void printEtGain()
ET gain.
StThreeVectorD getStarXYZ_4x4(int det, int col, int row) const
Get the STAR frame cooridnates for 4x4 sum.
StThreeVectorD projectTrackToHcalSMax(const g2t_track_st *g2ttrk, const g2t_vertex_st *g2tvert=0) const
SMax = Shower Max Z.
void setFcsHcalGainCorr(fcsHcalGainCorr_st *)
set fcsEcalGainCorr_st*
float getYWidth(int det) const
get the X width of the cell
double getHcalProjectedToEcalY(int ns, double hcalLocalY, double zvtx=0.0)
Project Hcal local Y to Ecal local Y [cm].
void getDepfromId(int detectorId, int id, int &ehp, int &ns, int &crt, int &slt, int &dep, int &ch) const
print ET gain
double getProjectedDistance(StFcsCluster *ecal, StFcsCluster *hcal, double zvtx=0.0)
Project Hcal cluster to Ecal plane and get distance from Ecal cluster [cm].