#include #include #include #include #include "Stntuple/obj/TStnHeaderBlock.hh" #include ClassImp(TDcasDataBlock) //______________________________________________________________________________ void TDcasDataBlock::Streamer(TBuffer &R__b) { // Stream an object of class TDcasDataBlock - this is the only // non-trivial method of this class if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(); if (R__v) { } R__b.ReadFastArray((Short_t*) fEmEnergy,24*24); R__b.ReadFastArray((Short_t*) fHdEnergy,24*24); R__b.ReadFastArray((Short_t*) fTowUsage,24*24); } else { R__b.WriteVersion(TDcasDataBlock::IsA()); R__b.WriteFastArray((Short_t*) fEmEnergy,24*24); R__b.WriteFastArray((Short_t*) fHdEnergy,24*24); R__b.WriteFastArray((Short_t*) fTowUsage,24*24); } } //_____________________________________________________________________________ TDcasDataBlock::TDcasDataBlock() { } //_____________________________________________________________________________ TDcasDataBlock::~TDcasDataBlock() { } //_____________________________________________________________________________ void TDcasDataBlock::Clear(Option_t* opt) { memset(fEmEnergy,0,24*24*sizeof(Short_t)); memset(fHdEnergy,0,24*24*sizeof(Short_t)); memset(fTowUsage,0,24*24*sizeof(Short_t)); } //_____________________________________________________________________________ void TDcasDataBlock::Print(Option_t* opt) const { if (strcmp(opt,"") == 0) { for(int i=0; i<3; i++) std::cout << " eta phi Em Had Use "; std::cout << std::endl; for (int ieta=0; ieta<24; ieta++) { for (int iphi=0; iphi<24; iphi++) { printf("%3i %3i %4i %3i %3x ", ieta, iphi, fEmEnergy[iphi][ieta],fHdEnergy[iphi][ieta], fTowUsage[iphi][ieta]); if(iphi%3==2) std::cout << std::endl; } } } else if (strcmp(opt,"tot") == 0) { //----------------------------------------------------------------------------- // print 24x24 matrix with the total energies to cross check MET //----------------------------------------------------------------------------- printf("iphi:ieta "); for (int i=0; i<24; i++) printf("%4i ",i); printf("\n"); for (int iphi=0; iphi<24; iphi++) { printf("%5i ",iphi); for (int ieta=0; ieta<24; ieta++) { printf("%5i",GetEnergy(iphi,ieta)); } printf("\n"); } } } //_____________________________________________________________________________ Int_t TDcasDataBlock::GetEntry(Int_t TreeEntry){ int current_entry = fEvent->GetCurrentEntry(); if (fCurrentEntry == current_entry) return 1; fCurrentEntry = current_entry; int out= fNode->GetEntry(TreeEntry); TStnEvent* ev= GetEvent(); TStnHeaderBlock* headerblock= (TStnHeaderBlock*) ev->GetDataBlock ("HeaderBlock"); Int_t mcflag=headerblock->McFlag(); //std::cout<<"MC Flag: "<RunNumber(); TStnMcCalibrations _fCALDIGITOGEV3_MC; _fCALDIGITOGEV3_MC.InitMC(rn); TStnMcCalibrations _fCALDIGITOGEV3; _fCALDIGITOGEV3.Init(rn); int NPhi = 24; int NETA = 24; //loop on eta and phi for(int iw=0;iw different scale for ADC to GeV conversion //-------------------- //Hadronic Calorimeter //-------------------- if ( (iw>=9 && iw<=11) || (iw>=12 && iw<=14) ){ K1_h = _fCALDIGITOGEV3_MC.GetChaScale(); K2_h = _fCALDIGITOGEV3. GetChaScale();} if ( iw==8 || iw==15 ){ //half had from WHA and half from CHA K1_h = (_fCALDIGITOGEV3_MC.GetChaScale()+_fCALDIGITOGEV3_MC.GetWhaScale())/2.; K2_h = (_fCALDIGITOGEV3. GetChaScale()+_fCALDIGITOGEV3. GetWhaScale())/2.;} if ( (iw>=6 && iw<=7 ) || (iw>=16 && iw<=17) ){ K1_h = _fCALDIGITOGEV3_MC.GetWhaScale(); K2_h = _fCALDIGITOGEV3. GetWhaScale();} if ( iw<6 || iw>17 ){ K1_h = _fCALDIGITOGEV3_MC.GetPhaScale(); K2_h = _fCALDIGITOGEV3. GetPhaScale();} //-------------------- //EM Calorimeter //-------------------- if ( (iw>=7 && iw<=11) || (iw>=12 && iw<=16) ){ K1_e = _fCALDIGITOGEV3_MC.GetCemScale(); K2_e = _fCALDIGITOGEV3. GetCemScale();} if ( iw<=6 || iw>=17){ K1_e = _fCALDIGITOGEV3_MC.GetPemScale(); K2_e = _fCALDIGITOGEV3. GetPemScale();} float Em1 = Em * K1_e/K2_e; float Had1 = Had * K1_h/K2_h; Short_t nEm = (Short_t) ( (Em1 * 8.0) +0.5); Short_t nHad = (Short_t) ( (Had1 * 8.0) +0.5); SetEmEnergy(ik,iw,nEm ); SetHdEnergy(ik,iw,nHad); } } return out; }