EmcRecTofDigitCalib Class Reference

#include <EmcRecTofDigitCalib.h>

List of all members.

Public Member Functions

 EmcRecTofDigitCalib ()
 ~EmcRecTofDigitCalib ()
void Convert (TofDigiCol *tofDigiCol, RecEmcTofHitMap &tofHitMap)


Detailed Description

Definition at line 12 of file EmcRecTofDigitCalib.h.


Constructor & Destructor Documentation

EmcRecTofDigitCalib::EmcRecTofDigitCalib (  ) 

Definition at line 10 of file EmcRecTofDigitCalib.cxx.

00011 {}

EmcRecTofDigitCalib::~EmcRecTofDigitCalib (  ) 

Definition at line 13 of file EmcRecTofDigitCalib.cxx.

00014 {}


Member Function Documentation

void EmcRecTofDigitCalib::Convert ( TofDigiCol tofDigiCol,
RecEmcTofHitMap tofHitMap 
)

Definition at line 16 of file EmcRecTofDigitCalib.cxx.

References cos(), energy, exp(), TofID::is_barrel(), TofID::layer(), TofID::phi_module(), boss::pos, sin(), RawDataUtil::TofCharge(), and RawDataUtil::TofTime().

00018 {
00019   TofDigiCol::iterator iter2;
00020   for(iter2=tofDigiCol->begin();
00021       iter2!=tofDigiCol->end();
00022       iter2++,iter2++) {
00023     
00024     Identifier id=(*iter2)->identify();
00025     bool   is_barrel    = TofID::is_barrel(id);
00026     int    layer        = TofID::layer(id);
00027     int    im           = TofID::phi_module(id);
00028     
00029     if(!is_barrel) return;
00030     
00031     double adc0 = RawDataUtil::TofCharge((*iter2)->getChargeChannel())*2;
00032     double tdc0 = RawDataUtil::TofTime((*iter2)->getTimeChannel());
00033     double adc1 = RawDataUtil::TofCharge((*(iter2+1))->getChargeChannel())*2;
00034     double tdc1 = RawDataUtil::TofTime((*(iter2+1))->getTimeChannel());
00035     
00036     double rand0 = (double)(rand()%100)/1000.-0.05;   //-0.05 --> 0.05
00037     double rand1 = (double)(rand()%100)/1000.-0.05;   //-0.05 --> 0.05
00038 
00039     //smear 5%
00040     adc0 *= (1+rand0);
00041     adc1 *= (1+rand1);
00042 
00043     double zpos, energy, e0, e1;
00044     zpos = 0.08331*(tdc1-tdc0);
00045     if(fabs(zpos)>1.15) continue;
00046 
00047     //ADC->energy
00048     if((adc0>46.&&adc0<920.) && (adc1<=46.||adc1>=920.)) {
00049       energy = adc0/exp(2.783+0.3133*zpos);
00050     } else if((adc1>46.&&adc1<920.) && (adc0<=46.||adc0>=920.)) {
00051       energy = adc1/exp(2.784-0.3079*zpos);
00052     } else if((adc0>46.&&adc0<920.) && (adc1>46.&&adc1<920.)) {
00053       e0 = adc0/exp(2.783+0.3133*zpos);
00054       e1 = adc1/exp(2.784-0.3079*zpos);
00055       energy = (e0+e1)/2;
00056     } else if(adc0>=920.&&adc1>=920.) {
00057       e0 = 920./exp(2.783+0.3133*zpos);
00058       e1 = 920./exp(2.784-0.3079*zpos);
00059       energy = e0>e1?e0:e1;
00060     } else {
00061       continue;
00062     }
00063 
00064     double phi,r;
00065     if(layer==0) {
00066       phi=(im+0.5)*CLHEP::twopi/88.;
00067       r=838.5;
00068     } else {
00069       phi=im*CLHEP::twopi/88.;
00070       r=895.5;
00071     }
00072 
00073     zpos*=1000; //zpos: m->mm
00074     HepPoint3D pos(r*cos(phi), r*sin(phi), zpos);
00075      
00076     tofHitMap[im+layer*88] = RecEmcTofHit(id, energy, pos);
00077   }
00078 }


Generated on Tue Nov 29 23:18:46 2016 for BOSS_7.0.2 by  doxygen 1.4.7