Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EmcRecShowerEnergy Class Reference

#include <EmcRecShowerEnergy.h>

List of all members.

Public Member Functions

void E3x3 (RecEmcShower &aShower)
void E3x3 (RecEmcShower &aShower)
void E5x5 (RecEmcShower &aShower)
void E5x5 (RecEmcShower &aShower)
void EAll (RecEmcShower &aShower)
void EAll (RecEmcShower &aShower)
RecEmcEnergy ECorrection (const RecEmcEnergy eIn)
RecEmcEnergy ECorrection (const RecEmcEnergy eIn)
RecEmcEnergy ECorrTheta (const RecEmcEnergy eIn, const RecEmcID &id)
RecEmcEnergy ECorrTheta (const RecEmcEnergy eIn, const RecEmcID &id)
void ELepton (RecEmcShower &aShower)
void ELepton (RecEmcShower &aShower)
void Energy (RecEmcShower &aShower)
void Energy (RecEmcShower &aShower)


Member Function Documentation

void EmcRecShowerEnergy::E3x3 RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::E3x3 RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::E5x5 RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::E5x5 RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::EAll RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::EAll RecEmcShower aShower  ) 
 

RecEmcEnergy EmcRecShowerEnergy::ECorrection const RecEmcEnergy  eIn  ) 
 

RecEmcEnergy EmcRecShowerEnergy::ECorrection const RecEmcEnergy  eIn  ) 
 

00124 {
00125   if(eIn>3.) return eIn;
00126 
00127   EmcRecParameter& Para=EmcRecParameter::GetInstance();
00128 
00129   RecEmcEnergy eOut=0;
00130   double par[4];
00131   for(int i=0;i<4;i++) {
00132     par[i]=Para.ECorr(i);
00133   }
00134 
00135   eOut = eIn/(par[0]+par[1]*eIn+par[2]*eIn*eIn+par[3]*eIn*eIn*eIn);
00136   return eOut;
00137 }

RecEmcEnergy EmcRecShowerEnergy::ECorrTheta const RecEmcEnergy  eIn,
const RecEmcID id
 

RecEmcEnergy EmcRecShowerEnergy::ECorrTheta const RecEmcEnergy  eIn,
const RecEmcID id
 

00140 {
00141   EmcRecParameter& Para=EmcRecParameter::GetInstance();
00142   RecEmcEnergy eOut=eIn;
00143 
00144   unsigned int npart = EmcID::barrel_ec(id);
00145   unsigned int ntheta = EmcID::theta_module(id);
00146 
00147   if(npart==1) {
00148     eOut *= 1.843/Para.Peak(ntheta);
00149   } else if(npart==0) {
00150     eOut *= 1.843/Para.Peak(ntheta+44);
00151   } else if(npart==2) {
00152     eOut *= 1.843/Para.Peak(ntheta+50);
00153   }
00154 
00155   return eOut;
00156 }

void EmcRecShowerEnergy::ELepton RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::ELepton RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::Energy RecEmcShower aShower  ) 
 

void EmcRecShowerEnergy::Energy RecEmcShower aShower  ) 
 

00007 {
00008   RecEmcFractionMap::const_iterator cit;
00009   RecEmcEnergy e1=0;
00010   RecEmcEnergy e9=0;
00011   RecEmcEnergy e25=0;
00012   RecEmcEnergy elepton=0;
00013   RecEmcEnergy eall=0;
00014 
00015   RecEmcID CellId=aShower.getShowerId();
00016   int module=EmcID::barrel_ec(CellId);
00017   RecEmcIDVector NearCell=EmcRecNeighbor::GetNeighbors(CellId);
00018   RecEmcIDVector NextNearCell=EmcRecNeighbor::GetNextNeighbors(CellId);
00019   RecEmcIDVector tmpNearCell;
00020   RecEmcIDVector tmpNextNearCell;
00021   i_RecEmcIDVector pNearCell;
00022   i_RecEmcIDVector pNextNearCell;
00023   vector<RecEmcEnergy> eVec;
00024   vector<RecEmcEnergy>::const_iterator ciVec;
00025 
00026   tmpNearCell.push_back(CellId);
00027   tmpNextNearCell.push_back(CellId);
00028 
00029   cit=aShower.Find(CellId);
00030   //int time_seed = cit->second.getTime();
00031   e1=(cit->second.getEnergy())*(cit->second.getFraction());
00032   e9+=(cit->second.getEnergy())*(cit->second.getFraction());
00033   e25+=(cit->second.getEnergy())*(cit->second.getFraction());
00034 
00035   //e3x3
00036   for(pNearCell=NearCell.begin();
00037       pNearCell!=NearCell.end();
00038       pNearCell++) {
00039     cit=aShower.Find(*pNearCell);
00040     if(cit!=aShower.End()) {
00041       tmpNearCell.push_back(*pNearCell);
00042       tmpNextNearCell.push_back(*pNearCell);
00043       e9+=cit->second.getEnergy()*cit->second.getFraction();
00044       e25+=cit->second.getEnergy()*cit->second.getFraction();
00045     }
00046   }
00047   
00048   //e5x5
00049   for(pNextNearCell=NextNearCell.begin();
00050       pNextNearCell!=NextNearCell.end();
00051       pNextNearCell++) {
00052     cit=aShower.Find(*pNextNearCell);
00053     if(cit!=aShower.End()) {
00054       tmpNextNearCell.push_back(*pNextNearCell);
00055       e25+=cit->second.getEnergy()*cit->second.getFraction();
00056     }
00057   }
00058 
00059   //eall
00060   for(cit=aShower.Begin();cit!=aShower.End();++cit) {
00061     eall+=(cit->second.getEnergy())*(cit->second.getFraction());
00062     eVec.push_back(cit->second.getEnergy()*cit->second.getFraction());
00063   }
00064 
00065   //calculate number of hits from MC
00066   int nHit,n;
00067   EmcRecParameter& Para=EmcRecParameter::GetInstance();
00068   nHit=(int)(Para.HitNb(0)*log(Para.HitNb(1)*e9+Para.HitNb(2)));
00069   n=0;
00070 
00071   //sort by energy
00072   sort(eVec.begin(), eVec.end(), greater<RecEmcEnergy>());
00073 
00074   for(ciVec=eVec.begin();ciVec!=eVec.end();ciVec++) {
00075     if(n<nHit) {
00076       elepton+=*ciVec;
00077       n++;
00078     }
00079   }
00080 
00081   //energy correction
00082   //RecEmcEnergy eCorr=ECorrTheta(e25,CellId);
00083   //RecEmcEnergy eCorr=ECorrection(e25);
00084   int getthetaid = EmcID::theta_module(CellId);
00085   int getmodule = EmcID::barrel_ec(CellId);
00086   if(getthetaid>21)getthetaid=43-getthetaid;
00087   if(getmodule==1)getthetaid=getthetaid+6;
00088   double dthetaid=double(getthetaid);
00089   double eCorr = Para.ECorrMC(e25,dthetaid);
00090 
00091   //energy error
00092   RecEmcEnergy de,de1,de2,de3;
00093   de1 = Para.SigE(0)/eCorr;
00094   de2 = Para.SigE(1)/pow(eCorr,0.25);
00095   de3 = Para.SigE(2);
00096   de = sqrt(de1*de1+de2*de2+de3*de3)*perCent*eCorr;
00097 
00098   double err = Para.ErrMC(e25,dthetaid);
00099   if(err>0) de = err*e25;
00100 
00101   aShower.setTrackId(-1);
00102   aShower.setCellId(CellId);
00103   aShower.setModule(module);
00104   aShower.setNumHits(aShower.getSize());
00105   aShower.setDE(de);
00106   aShower.CellId3x3(tmpNearCell);
00107   aShower.CellId5x5(tmpNextNearCell);
00108   aShower.setESeed(e1);
00109   aShower.setE3x3(e9);
00110   aShower.setE5x5(e25);
00111   aShower.ELepton(elepton);
00112   aShower.EAll(eall);
00113   aShower.setEnergy(eCorr);
00114 
00115   //cout<<"e1="<<aShower.eSeed()
00116   //  <<"\te9="<<aShower.e3x3()
00117   //  <<"\te25="<<aShower.e5x5()
00118   //  <<"\telepton="<<aShower.getELepton()
00119   //  <<"\teall="<<aShower.getEAll()
00120   //  <<"\tenergy="<<aShower.energy()<<endl;
00121 }


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:02:05 2011 for BOSS6.5.5 by  doxygen 1.3.9.1