00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "emcCalibratedDataObject.h"
00013 #include <iomanip>
00014 #include <cassert>
00015 #include "TMath.h"
00016 #include "EmcIndexer.h"
00017
00018 ClassImp(emcCalibratedDataObject)
00019
00020 using namespace std;
00021
00022
00023 emcCalibratedDataObject::emcCalibratedDataObject() : PHObject()
00024 {
00025 fEnergy = 0 ;
00026 fETotal = 0 ;
00027 fTime = 0 ;
00028 fTowerId = 0 ;
00029 fSoftwareKey = 0;
00030 fDeadNeighbours = 0 ;
00031 fEnergyCalibrated = fTimeCalibrated = fZeroSuppressed = false ;
00032 fSize = fMaxSize = 0 ;
00033 fReadOnly = false ;
00034
00035
00036 fWarnNeighbours=0;
00037 }
00038
00039
00040 emcCalibratedDataObject::emcCalibratedDataObject(const emcCalibratedDataObject& cdo) : PHObject()
00041 {
00042 cdo.copyTo(*this) ;
00043 }
00044
00045
00046 emcCalibratedDataObject&
00047 emcCalibratedDataObject::operator=(const emcCalibratedDataObject& cdo)
00048 {
00049 if ( &cdo != this )
00050 {
00051 delete[] cdo.fEnergy;
00052 delete[] cdo.fTime;
00053 delete[] cdo.fTowerId;
00054 delete[] cdo.fDeadNeighbours;
00055 delete[] cdo.fWarnNeighbours;
00056 delete[] cdo.fSoftwareKey;
00057 cdo.copyTo(*this);
00058 }
00059 return *this;
00060 }
00061
00062 void emcCalibratedDataObject::copyTo(emcCalibratedDataObject& cdo) const
00063 {
00064
00065
00066
00067
00068 cdo.fMaxSize = fMaxSize ;
00069 cdo.fSize = fSize ;
00070 cdo.fEnergyCalibrated = fEnergyCalibrated ;
00071 cdo.fTimeCalibrated = fTimeCalibrated ;
00072 cdo.fZeroSuppressed = fZeroSuppressed ;
00073
00074 Int_t i ;
00075
00076 cdo.fEnergy = new Float_t[fMaxSize] ;
00077 cdo.fTime = new Float_t[fMaxSize] ;
00078 cdo.fTowerId = new Int_t[fMaxSize] ;
00079 cdo.fDeadNeighbours = new Int_t[fMaxSize] ;
00080 cdo.fWarnNeighbours = new Int_t[fMaxSize] ;
00081 cdo.fSoftwareKey = new long[fMaxSize] ;
00082
00083 for ( i = 0 ; i < fSize ; i++ ) {
00084 cdo.fEnergy[i] = fEnergy[i] ;
00085 cdo.fTime[i] = fTime[i] ;
00086 cdo.fTowerId[i] = fTowerId[i] ;
00087 cdo.fDeadNeighbours[i] = fDeadNeighbours[i] ;
00088
00089
00090 cdo.fWarnNeighbours[i]=fWarnNeighbours[i];
00091 }
00092
00093
00094 cdo.fIndexMap.clear() ;
00095 for ( i = 0 ; i < fSize ; i++ ) {
00096 cdo.fIndexMap[ cdo.fTowerId[i] ] = i ;
00097 cdo.fSoftwareKey[i] = GenerateSoftwareKey( cdo.fTowerId[i] ) ;
00098 }
00099
00100 cdo.ComputeTotalEnergy() ;
00101 }
00102
00103
00104 emcCalibratedDataObject::~emcCalibratedDataObject()
00105 {
00106 delete[] fEnergy ;
00107 delete[] fTime ;
00108 delete[] fTowerId ;
00109 delete[] fSoftwareKey ;
00110 delete[] fDeadNeighbours ;
00111
00112
00113 delete [] fWarnNeighbours;
00114 }
00115
00116
00117 emcCalibratedDataObject& emcCalibratedDataObject::operator += (const emcCalibratedDataObject& obj)
00118 {
00119
00120
00121
00122
00123 if ( fZeroSuppressed != obj.fZeroSuppressed ) {
00124 cerr << "<W> emcCalibratedDataObject::operator+= : "
00125 << " different fZeroSuppressed !"
00126 << " Operation aborted (object unchanged)"
00127 << endl ;
00128 return *this ;
00129
00130 }
00131
00132
00133 bool ro = fReadOnly ;
00134
00135
00136
00137 fReadOnly = false ;
00138
00139 Int_t i ;
00140 Int_t loop = obj.GetSize() ;
00141 Int_t twrIndex = 0 ;
00142 Int_t index = 0 ;
00143 float energy = 0.;
00144 float thetime = 0.;
00145 int neighbour = 0 ;
00146 int neighbourWarn = 0;
00147 long softkey = 0;
00148 int towerid = 0 ;
00149
00150 for ( i = 0 ; i < loop ; i++ ) {
00151
00152 twrIndex = obj.GetTowerId(i) ;
00153 index = GetIndexFromTowerId(twrIndex) ;
00154
00155 if (index==-1) {
00156
00157 Set(fSize,obj.GetTowerId(i),obj.GetSoftwareKey(i),0,
00158 obj.GetEnergy(i),obj.GetTime(i),obj.GetDead(i), obj.GetWarn(i)) ;
00159 }
00160 else {
00161
00162 energy = obj.fEnergy[i] + fEnergy[index] ;
00163
00164
00165
00166 thetime = TMath::Min(obj.fTime[i],fTime[index]) ;
00167 neighbour = ( obj.GetDead(i) | GetDead(index) ) ;
00168 neighbourWarn = (obj.GetWarn(i) | GetWarn(index));
00169
00170
00171
00172 softkey = (GetSoftwareKey(index)) ? GetSoftwareKey(index) : obj.GetSoftwareKey(i);
00173 towerid = (GetTowerId(index)) ? (GetTowerId(index)) : obj.GetTowerId(i);
00174
00175
00176
00177 if (!softkey) softkey = GenerateSoftwareKey(index);
00178
00179 Set(index,towerid,softkey,0,energy,thetime,neighbour,neighbourWarn) ;
00180 }
00181 }
00182
00183
00184 Update();
00185
00186
00187 fReadOnly = ro ;
00188
00189 return *this ;
00190 }
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 Int_t emcCalibratedDataObject::CountHits(Float_t twrEThreshold) const
00201 {
00202 int hits = 0 ;
00203 if (fEnergyCalibrated) {
00204 int i ;
00205 for ( i = 0 ; i < fSize ; i++ ) hits += ( fEnergy[i] > twrEThreshold ) ;
00206 }
00207 return hits ;
00208 }
00209
00210
00211 Float_t emcCalibratedDataObject::ComputeTotalEnergy()
00212 {
00213 fETotal = 0 ;
00214 if (fEnergyCalibrated) {
00215 fETotal = 0 ;
00216 int i ;
00217 for ( i = 0 ; i < fSize ; i++) fETotal += fEnergy[i] ;
00218 return fETotal;
00219 } else { return 0.;}
00220 }
00221
00222
00223 void emcCalibratedDataObject::DecodeKey(long key, Int_t& arm, Int_t& sector, Int_t& yrow, Int_t& zrow) const
00224 {
00225 arm = key / 100000 ;
00226 sector = ( key - arm * 100000 ) / 10000 ;
00227 yrow = ( key - arm * 100000 - sector * 10000 ) / 100 ;
00228 zrow = key - arm * 100000 - sector * 10000 - yrow * 100 ;
00229 }
00230
00231
00232 long emcCalibratedDataObject::GenerateSoftwareKey(Int_t ItemId) const
00233 {
00234
00235 int iS ;
00236 int iSMT ;
00237 int iarm ;
00238 int iy ;
00239 int iz ;
00240
00241
00242
00243 int swkey ;
00244
00245
00246
00247
00248
00249
00250 EmcIndexer::iPXiSiST(ItemId,iS,iSMT) ;
00251
00252 iarm = ((iS<4)?0:1) ;
00253 if (iS<6) {
00254 iy = iSMT/72 ;
00255 iz = iSMT%72 ;
00256 }
00257 else {
00258 iy = iSMT/96 ;
00259 iz = iSMT%96 ;
00260 }
00261
00262 if(iS>=4){
00263
00264 iS = ((iS -=6)<0)? iS+4 : iS;
00265 }
00266 swkey = 100000*iarm + 10000*iS + 100*iy + iz ;
00267
00268 return swkey ;
00269 }
00270
00271
00272
00273 void emcCalibratedDataObject::Get (Int_t index,
00274 Float_t& energy, Float_t& tof) const
00275 {
00276
00277
00278
00279 if ( ValidIndex(index) ) {
00280 tof = fTime[index] ;
00281 energy = fEnergy[index] ;
00282 }
00283 else {
00284 energy = tof = 0 ;
00285 }
00286 }
00287
00288
00289 void emcCalibratedDataObject::Get( Int_t index,
00290 Int_t& TowerId, long & softwareKey,
00291 Int_t & dummy,
00292 Float_t& energy, Float_t& tof ) const
00293 {
00294
00295
00296
00297 if ( ValidIndex(index) ) {
00298 energy = fEnergy[index] ;
00299 tof = fTime[index] ;
00300 TowerId = fTowerId[index] ;
00301 softwareKey = fSoftwareKey[index] ;
00302 dummy = 0 ;
00303 }
00304 else {
00305 energy = tof = 0 ;
00306 }
00307 }
00308
00309
00310 void emcCalibratedDataObject::GetByTowerId( Int_t TowerId,
00311 Float_t& energy, Float_t& tof ) const
00312 {
00313
00314 Int_t index = GetIndexFromTowerId(TowerId) ;
00315 if (index>=0) {
00316 energy = fEnergy[index] ;
00317 tof = fTime[index];
00318 } else {
00319 energy = 0.;
00320 tof = 0.;
00321 }
00322 }
00323
00324
00325 Int_t emcCalibratedDataObject::GetDead(Int_t index) const
00326 {
00327 Int_t dead = 0 ;
00328
00329 if ( ValidIndex(index) ) dead = fDeadNeighbours[index] ;
00330
00331 return dead ;
00332 }
00333
00334
00335 Int_t emcCalibratedDataObject::GetWarn(Int_t index) const
00336 {
00337
00338
00339 Int_t warn=0;
00340
00341 if(ValidIndex(index)) warn=fWarnNeighbours[index] ;
00342
00343 return warn;
00344 }
00345
00346
00347 Int_t emcCalibratedDataObject::GetDeadByTowerId(Int_t TowerId) const
00348 {
00349
00350 Int_t index = GetIndexFromTowerId(TowerId) ;
00351
00352 if (index>=0) {
00353 return fDeadNeighbours[index] ;
00354 }
00355 else {
00356 return 0 ;
00357 }
00358 }
00359
00360
00361 Int_t emcCalibratedDataObject::GetWarnByTowerId(Int_t TowerId) const
00362 {
00363
00364
00365 Int_t index = GetIndexFromTowerId(TowerId) ;
00366
00367 if (index>=0) {
00368 return fWarnNeighbours[index] ;
00369 }
00370 else {
00371 return 0 ;
00372 }
00373 }
00374
00375
00376 Float_t emcCalibratedDataObject::GetEnergy(Int_t index) const
00377 {
00378 Float_t energy = 0 ;
00379
00380 if (ValidIndex(index)) energy = fEnergy[index] ;
00381
00382 return energy ;
00383 }
00384
00385
00386 Float_t emcCalibratedDataObject::GetEnergyByTowerId(Int_t TowerId) const
00387 {
00388
00389 Int_t index = GetIndexFromTowerId(TowerId) ;
00390
00391 if (index>=0) {
00392 return fEnergy[index] ;
00393 }
00394 else {
00395 return 0.;
00396 }
00397 }
00398
00399
00400 Int_t emcCalibratedDataObject::GetIndexFromTowerId(Int_t TowerId) const
00401 {
00402
00403 map<int,int>::const_iterator p = fIndexMap.find(TowerId) ;
00404 if (p!=fIndexMap.end()) {
00405 return p->second ;
00406 }
00407 else {
00408 return -1;
00409 }
00410 }
00411
00412
00413 void emcCalibratedDataObject::GetPointers(float*& ENERGY, float*& TOF)
00414 {
00415
00416 ENERGY = fEnergy ;
00417 TOF = fTime ;
00418 }
00419
00420
00421
00422 void emcCalibratedDataObject::GetSectorEnergies(Float_t * e)
00423 {
00424
00425 int i ;
00426 for (i=0;i<8;i++) e[i]=0;
00427 for (int index = 0; index < GetSize(); index++ ) {
00428 int is = 4*(fSoftwareKey[index]/100000) +
00429 (fSoftwareKey[index]%100000)/10000 ;
00430 e[is] += fEnergy[index];
00431 }
00432 }
00433
00434
00435 void emcCalibratedDataObject::GetSMEnergies(Float_t* e)
00436 {
00437 int i ;
00438 for (i=0;i<GetMaxSize()/144;i++) e[i]=0;
00439 int towerid ;
00440 int sector ;
00441 int sm144,sm144sector ;
00442 int st ;
00443 int sm144t ;
00444
00445 for ( i = 0 ; i < GetSize() ; i++) {
00446
00447 towerid = fTowerId[i] ;
00448
00450 EmcIndexer::iPXiSiST(towerid,sector,st) ;
00451
00453 EmcIndexer::iSiSTiSMiSMT(sector,st,sm144sector,sm144t) ;
00454
00456 sm144 = EmcIndexer::iSiSM144_PXSM144(sector , sm144sector);
00457
00458 e[sm144] += fEnergy[i] ;
00459 }
00460 }
00461
00462
00463 long emcCalibratedDataObject::GetSoftwareKey(Int_t index) const
00464 {
00465 long softkey = 0 ;
00466
00467 if (ValidIndex(index)) softkey = fSoftwareKey[index] ;
00468
00469 return softkey ;
00470 }
00471
00472
00473 Float_t emcCalibratedDataObject::GetTime(Int_t index) const
00474 {
00475 Float_t t = 0 ;
00476
00477 if (ValidIndex(index)) t = fTime[index] ;
00478
00479 return t ;
00480 }
00481
00482
00483 Float_t emcCalibratedDataObject::GetTimeByTowerId(Int_t TowerId) const
00484 {
00485
00486 Int_t index = GetIndexFromTowerId(TowerId) ;
00487
00488 if (index>=0) {
00489 return fTime[index] ;
00490 }
00491 else {
00492 return 0.;
00493 }
00494 }
00495
00496
00497 Int_t emcCalibratedDataObject::GetTowerId(Int_t index) const
00498 {
00499 Int_t towerId = 0 ;
00500
00501 if (ValidIndex(index)) towerId = fTowerId[index] ;
00502
00503 return towerId ;
00504 }
00505
00506
00507 void emcCalibratedDataObject::identify(ostream& out) const
00508 {
00509 out << "I am an emcCalibratedDataObject" << endl ;
00510 }
00511
00512
00513 Bool_t emcCalibratedDataObject::IsCalibrated(TString what) const
00514 {
00515 if ( what == "energy" )
00516 return fEnergyCalibrated ;
00517 else if ( what == "time" )
00518 return fTimeCalibrated ;
00519 else {
00520 cout << "emcRawDataCalibrator::IsCalibrated > " << what << " is a wrong option" << endl ;
00521 return kFALSE ;
00522 }
00523 }
00524
00525
00526 void emcCalibratedDataObject::Set(int index, int TowerId, long softwareKey,
00527 int , float energy, float time,
00528 Int_t deadNeighbours, Int_t warnNeighbours)
00529 {
00530
00531
00532 if (fReadOnly) {
00533 cerr << "<W> emcCalibratedDataObject::Set(all stuff) : Object is read-only" << endl ;
00534 }
00535 else {
00536
00537 if (index>=fMaxSize) {
00538 assert(fSize==fMaxSize) ;
00539 if (!fMaxSize) {
00540
00541 fMaxSize = 1000 ;
00542 fEnergy = new Float_t[fMaxSize] ;
00543 fTime = new Float_t[fMaxSize] ;
00544 fTowerId = new Int_t[fMaxSize] ;
00545 fSoftwareKey = new long[fMaxSize] ;
00546 fDeadNeighbours = new Int_t[fMaxSize] ;
00547
00548
00549 fWarnNeighbours=new Int_t[fMaxSize];
00550
00551 int i ;
00552 for (i=0;i<fMaxSize;i++) {
00553 fEnergy[i]=fTime[i]=0;
00554 fTowerId[i]=fDeadNeighbours[i]=0;
00555 fSoftwareKey[i]=0;
00556 }
00557 }
00558 else {
00559 int verymaxsize = 25000 ;
00560 int oldsize = fMaxSize ;
00561
00562 fMaxSize = TMath::Min(verymaxsize,fMaxSize*2) ;
00563
00564 Float_t* newEnergy = new Float_t[fMaxSize] ;
00565 Float_t* newTime = new Float_t[fMaxSize] ;
00566 Int_t* newTowerId = new Int_t[fMaxSize] ;
00567 long* newSoftwareKey = new long[fMaxSize] ;
00568 Int_t* newDeadNeighbours = new Int_t[fMaxSize] ;
00569
00570
00571 Int_t* newWarnNeighbours=new Int_t[fMaxSize];
00572
00573 int i ;
00574 for (i=0;i<oldsize;i++) {
00575 newEnergy[i] = fEnergy[i] ;
00576 newTime[i] = fTime[i] ;
00577 newTowerId[i] = fTowerId[i] ;
00578 newSoftwareKey[i] = fSoftwareKey[i] ;
00579 newDeadNeighbours[i] = fDeadNeighbours[i] ;
00580
00581
00582 newWarnNeighbours[i]=fWarnNeighbours[i];
00583
00584 }
00585
00586 delete[] fEnergy ;
00587 delete[] fTime ;
00588 delete[] fTowerId ;
00589 delete[] fSoftwareKey ;
00590 delete[] fDeadNeighbours ;
00591
00592
00593 delete [] fWarnNeighbours;
00594
00595 fEnergy = newEnergy ;
00596 fTime = newTime ;
00597 fTowerId = newTowerId ;
00598 fSoftwareKey = newSoftwareKey ;
00599 fDeadNeighbours = newDeadNeighbours ;
00600
00601
00602 fWarnNeighbours=newWarnNeighbours;
00603
00604 }
00605 }
00606
00607 fSize = TMath::Max(fSize,index+1) ;
00608
00609 fIndexMap[TowerId] = index ;
00610 fTowerId[index] = TowerId ;
00611 fSoftwareKey[index] = softwareKey ;
00612 fEnergy[index] = energy ;
00613 fTime[index] = time ;
00614 fDeadNeighbours[index] = deadNeighbours ;
00615
00616
00617 fWarnNeighbours[index]=warnNeighbours;
00618
00619 }
00620 }
00621
00622
00623 void emcCalibratedDataObject::SetMaxSize(Int_t thesize)
00624 {
00625 Reset();
00626 if (!fMaxSize) {
00627
00628 fMaxSize = thesize ;
00629 fEnergy = new Float_t[fMaxSize] ;
00630 fTime = new Float_t[fMaxSize] ;
00631 fTowerId = new Int_t[fMaxSize] ;
00632 fSoftwareKey = new long[fMaxSize] ;
00633 fDeadNeighbours = new Int_t[fMaxSize] ;
00634 fWarnNeighbours = new Int_t[fMaxSize];
00635
00636 int i ;
00637 for (i=0;i<fMaxSize;i++) {
00638 fEnergy[i]=fTime[i]=0;
00639 fTowerId[i]=fDeadNeighbours[i]=0;
00640 fSoftwareKey[i]=0;
00641 }
00642 }
00643 }
00644
00645
00646
00647 void emcCalibratedDataObject::Reset(void)
00648 {
00649 fSize=0;
00650 fIndexMap.clear() ;
00651 fEnergyCalibrated=fTimeCalibrated=false ;
00652 }
00653
00654
00655
00656 void emcCalibratedDataObject::resetByIndex(int index)
00657 {
00658 if (index<fSize) {
00659 fEnergy[index] = 0.;
00660 fTime[index] = 0.;
00661 }
00662 }
00663
00664
00665
00666 void emcCalibratedDataObject::resetByTowerId(int TowerId)
00667 {
00668 Int_t index = GetIndexFromTowerId(TowerId) ;
00669 if(index>=0){
00670 fEnergy[index] = 0.;
00671 fTime[index] = 0.;
00672 }
00673 }
00674
00675
00676 TString emcCalibratedDataObject::Status()
00677 {
00678 TString status ;
00679 TString blank = " " ;
00680 status = "emcCalibratedDataObject status : \n" ;
00681 status += blank ;
00682
00683 if ( IsCalibrated("energy") )
00684 status += "Energy calibration have been applied\n" ;
00685 else
00686 status += "Energy calibration have NOT been applied\n" ;
00687
00688 status += blank ;
00689
00690 if ( IsCalibrated("time") )
00691 status += "Time calibration have been applied\n" ;
00692 else
00693 status += "Time calibration have NOT been applied\n" ;
00694
00695 status += blank ;
00696 if ( IsZeroSuppressed() )
00697 status += "Zero suppression has been applied\n" ;
00698 else
00699 status += "Zero suppression has not been applied\n" ;
00700
00701 return status ;
00702 }
00703
00704
00705 void emcCalibratedDataObject::Streamer(TBuffer &R__b)
00706 {
00707
00708
00709
00710
00711 if (R__b.IsReading()) {
00712
00713 Version_t R__v = R__b.ReadVersion();
00714
00715 if (R__v==1) { cerr << "CDO Streamer : Cannot read anylonger this version of CDO!" << endl;}
00716
00717 TObject::Streamer(R__b) ;
00718
00719 R__b >> fSize ;
00720
00721 if ( fSize > fMaxSize) {
00722
00723
00724 delete[] fEnergy ;
00725 delete[] fTime ;
00726 delete[] fTowerId ;
00727 delete[] fSoftwareKey;
00728 delete[] fDeadNeighbours ;
00729
00730
00731 delete [] fWarnNeighbours;
00732
00733 fMaxSize = fSize ;
00734
00735 fEnergy = new Float_t[fMaxSize] ;
00736 fTime = new Float_t[fMaxSize] ;
00737 fTowerId = new Int_t [fMaxSize] ;
00738 fSoftwareKey = new long [fMaxSize] ;
00739 fDeadNeighbours = new Int_t [fMaxSize] ;
00740
00741
00742 fWarnNeighbours=new Int_t[fMaxSize];
00743
00744 }
00745
00746 R__b >> fEnergyCalibrated;
00747 R__b >> fTimeCalibrated;
00748 R__b >> fZeroSuppressed;
00749
00750 R__b.ReadFastArray(fEnergy, fSize);
00751 R__b.ReadFastArray(fTime, fSize);
00752 R__b.ReadFastArray(fTowerId, fSize);
00753 R__b.ReadFastArray(fDeadNeighbours, fSize);
00754
00755
00756 if(R__v>2){
00757
00758 R__b.ReadFastArray(fWarnNeighbours, fSize);
00759
00760 } else{
00761
00762 memset((void*)fWarnNeighbours, 0, fSize*sizeof(Int_t));
00763
00764 }
00765
00766
00767
00768 int i ;
00769 fIndexMap.clear() ;
00770 for ( i = 0 ; i < fSize ; i++ ) {
00771 fIndexMap[ fTowerId[i] ] = i ;
00772 fSoftwareKey[i] = GenerateSoftwareKey( fTowerId[i] ) ;
00773 }
00774
00775 for ( i = fSize ; i < fMaxSize ; i++ ) {
00776 fEnergy[i] = fTime[i] = 0 ;
00777 fTowerId[i] = 0 ;
00778 fSoftwareKey[i] = 0 ;
00779 fDeadNeighbours[i] = 0 ;
00780
00781
00782 fWarnNeighbours[i]=0;
00783
00784 }
00785
00786 ComputeTotalEnergy() ;
00787
00788 fReadOnly = true ;
00789
00790 } else {
00791
00792 R__b.WriteVersion(emcCalibratedDataObject::IsA());
00793 TObject::Streamer(R__b);
00794
00795 R__b << fSize ;
00796
00797 R__b << fEnergyCalibrated ;
00798 R__b << fTimeCalibrated ;
00799 R__b << fZeroSuppressed ;
00800
00801
00802 R__b.WriteFastArray(fEnergy, fSize) ;
00803 R__b.WriteFastArray(fTime, fSize) ;
00804 R__b.WriteFastArray(fTowerId, fSize);
00805 R__b.WriteFastArray(fDeadNeighbours, fSize);
00806
00807
00808 R__b.WriteFastArray(fWarnNeighbours, fSize);
00809
00810 }
00811 }
00812
00813
00814 void emcCalibratedDataObject::Update(void)
00815 {
00816 Int_t i;
00817
00818 fIndexMap.clear() ;
00819 for ( i = 0 ; i < fSize ; i++ ) {
00820 fIndexMap[ fTowerId[i] ] = i ;
00821 fSoftwareKey[i] = GenerateSoftwareKey( fTowerId[i] ) ;
00822 }
00823 ComputeTotalEnergy() ;
00824 }
00825
00826
00827 ostream& operator << (ostream& out, const emcCalibratedDataObject& cdo)
00828 {
00829 if (cdo.fTowerId) {
00830 int i ;
00831
00832
00833 char* head = " Tower : arm sector yrow zrow GeV ns DeadNeighbours WarnNeighbours";
00834 out << head << endl ;
00835 out << dec ;
00836 Int_t arm, sector, yrow, zrow ;
00837 TString ans ;
00838 for (i = 0; i < cdo.GetSize(); i++) {
00839
00840 if ( (i+1) % 1000 == 0 ) {
00841 cout << "S(top) or C(ontinue) ? " ;
00842 cin >> ans ;
00843 cout << endl ;
00844 if ( ans == "s" || ans == "S" )
00845 break ;
00846 out << head << endl ;
00847 }
00848
00849 cdo.DecodeKey( cdo.GetSoftwareKey(i), arm,sector, yrow, zrow) ;
00850 out << "#" << cdo.GetTowerId(i) << " : "
00851 << arm
00852 << sector
00853 << yrow
00854 << setprecision(2)
00855 << zrow
00856 << " "
00857 << setprecision(8) << cdo.fEnergy[i]
00858 << " "
00859 << setprecision(8) << cdo.fTime[i]
00860 << ") "
00861 << " D" << cdo.GetDead(i)
00862
00863
00864 << " W" << cdo.GetWarn(i)
00865 << endl ;
00866 }
00867 }
00868 return out ;
00869 }