#include <EmcRecDigit2Hit.h>
Public Member Functions | |
void | Convert (const RecEmcDigitMap &aDigitMap, RecEmcHitMap &aHitMap) |
void | Convert (const RecEmcDigitMap &aDigitMap, RecEmcHitMap &aHitMap) |
EmcRecDigit2Hit () | |
EmcRecDigit2Hit () | |
void | Output (const RecEmcHitMap &aHitMap) const |
void | Output (const RecEmcHitMap &aHitMap) const |
void | OutputEndcap (const RecEmcHitMap &aHitMap, const unsigned int module_ew) const |
void | OutputEndcap (const RecEmcHitMap &aHitMap, const unsigned int module_ew) const |
~EmcRecDigit2Hit () | |
~EmcRecDigit2Hit () |
|
00020 {}
|
|
00023 {}
|
|
|
|
|
|
|
|
00027 { 00028 RecEmcDigitMap::const_iterator ciDigitMap; 00029 RecEmcHit aHit; 00030 00031 EmcRecParameter& Para=EmcRecParameter::GetInstance(); 00032 00033 // Get EmcCalibConstSvc. 00034 IEmcCalibConstSvc *emcCalibConstSvc; 00035 StatusCode sc = Gaudi::svcLocator()->service("EmcCalibConstSvc", emcCalibConstSvc); 00036 if(sc != StatusCode::SUCCESS) { 00037 cout << "EmcRecDigit2Hit Error: Can't get EmcCalibConstSvc." << endl; 00038 } 00039 00040 // Get RawDataProviderSvc 00041 IRawDataProviderSvc *rawDataProviderSvc; 00042 sc = Gaudi::svcLocator()->service("RawDataProviderSvc", rawDataProviderSvc); 00043 if(sc != StatusCode::SUCCESS) { 00044 cout << "EmcRecDigit2Hit Error: Can't get RawDataProviderSvc." << endl; 00045 } 00046 00047 for(ciDigitMap=aDigitMap.begin(); 00048 ciDigitMap!=aDigitMap.end(); 00049 ++ciDigitMap) { 00050 00051 const RecEmcDigit &aDigit=ciDigitMap->second; 00052 00053 aHit.CellId(aDigit.CellId()); 00054 00055 double ein,ecorr,eout; 00056 ein=aDigit.ADC(); 00057 00058 //Times the calibration constant in offline mode 00059 if(!(rawDataProviderSvc->isOnlineMode()) && Para.DigiCalib()) { 00060 00061 unsigned int partId = EmcID::barrel_ec(aDigit.CellId()); 00062 unsigned int theta = EmcID::theta_module(aDigit.CellId()); 00063 unsigned int phi = EmcID::phi_module(aDigit.CellId()); 00064 00065 int index = emcCalibConstSvc->getIndex(partId,theta,phi); 00066 ein *= emcCalibConstSvc->getDigiCalibConst(index); 00067 00068 } 00069 00070 // Correct electronic noise bias. Not used now. 00071 if(ein<Para.ElecBias(4)) { 00072 ecorr=Para.ElecBias(0)*log(ein/Para.ElecBias(1)); //noise=0.5 00073 } else { 00074 ecorr=Para.ElecBias(2)+Para.ElecBias(3)*ein; 00075 } 00076 eout=ein; 00077 aHit.Energy(eout/GeV); 00078 00079 aHit.Time(aDigit.TDC()); 00080 // For some reason, there are 0 energy hit. 00081 // Avoid this to happen, dangerous! 00082 if(aHit.getEnergy()>=Para.ElectronicsNoiseLevel()){// && 00083 //(aHit.time()>=Para.TimeMin()) && 00084 //(aHit.time()<=Para.TimeMax())) 00085 aHitMap[aHit.getCellId()]=aHit; 00086 } 00087 } 00088 00089 }
|
|
|
|
00092 { 00093 unsigned int module,theta,phi; 00094 RecEmcID id; 00095 RecEmcHitMap::const_iterator ci_HitMap; 00096 RecEmcEnergy e; 00097 int ie; 00098 00099 cout<<"Output a hitmap:"<<endl; 00100 00101 module=EmcID::EmcID::getBARREL(); 00102 00103 cout<<"Barrel:"<<endl; 00104 cout<<"+--------------------------------------------+"<<endl; 00105 for(phi=EmcID::getPHI_BARREL_MAX(); 00106 phi!=EmcID::getPHI_BARREL_MIN()-1; 00107 --phi) { 00108 cout<<"|"; 00109 for(theta=EmcID::getTHETA_BARREL_MIN(); 00110 theta<=EmcID::getTHETA_BARREL_MAX(); 00111 ++theta) { 00112 id=EmcID::crystal_id(module,theta,phi); 00113 ci_HitMap=aHitMap.find(id); 00114 if(ci_HitMap!=aHitMap.end()) { 00115 e=ci_HitMap->second.getEnergy(); 00116 ie=(int)(e*10); 00117 if(ie>9) { 00118 ie=9; 00119 } 00120 cout<<ie; 00121 } else { 00122 cout<<" "; 00123 } 00124 } 00125 cout<<"|"<<endl; 00126 } 00127 cout<<"+--------------------------------------------+"<<endl; 00128 00129 module=EmcID::EmcID::getENDCAP_EAST(); 00130 OutputEndcap(aHitMap,module); 00131 module=EmcID::EmcID::getENDCAP_WEST(); 00132 OutputEndcap(aHitMap,module); 00133 }
|
|
|
|
00136 { 00137 unsigned int module,theta,phi; 00138 RecEmcID id; 00139 RecEmcHitMap::const_iterator ci_HitMap; 00140 RecEmcEnergy e; 00141 int ie; 00142 00143 module=module_ew; 00144 if(module==EmcID::EmcID::getENDCAP_EAST()){ 00145 cout<<"East endcap:"<<endl; 00146 } 00147 else if(module==EmcID::EmcID::getENDCAP_WEST()){ 00148 cout<<"West endcap:"<<endl; 00149 } 00150 00151 cout<<"+--------------------------------------------------------+"<<endl; 00152 for(theta=EmcID::getTHETA_ENDCAP_MAX(); 00153 theta!=EmcID::getTHETA_ENDCAP_MIN()-1; 00154 theta--){ 00155 cout<<"|"; 00156 for(phi=(EmcID::getPHI_ENDCAP_MAX(theta)-1)/2; 00157 phi!=EmcID::getPHI_ENDCAP_MIN()-1; 00158 phi--) { 00159 id=EmcID::crystal_id(module,theta,phi); 00160 ci_HitMap=aHitMap.find(id); 00161 if(ci_HitMap!=aHitMap.end()) { 00162 e=ci_HitMap->second.getEnergy(); 00163 ie=(int)(e*10); 00164 if(ie>9) { 00165 ie=9; 00166 } 00167 if((theta<4) && 00168 (phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==(EmcID::getPHI_ENDCAP_MAX(theta)+1)/16-1)){ 00169 cout<<"*"; 00170 } 00171 cout<<ie; 00172 if((theta==0||theta==1)&&(phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00173 cout<<"*"; 00174 } 00175 } 00176 else{ 00177 if((theta<4) && 00178 (phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==(EmcID::getPHI_ENDCAP_MAX(theta)+1)/16-1)){ 00179 cout<<" "; 00180 } 00181 cout<<" "; 00182 if((theta==0||theta==1)&&(phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00183 cout<<" "; 00184 } 00185 } 00186 if(phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0){ 00187 cout<<"|"; 00188 } 00189 if(phi==(EmcID::getPHI_ENDCAP_MAX(theta)+1)/4){ 00190 cout<<"|"; 00191 } 00192 } 00193 cout<<endl; 00194 } 00195 cout<<"+--------------------------------------------------------+"<<endl; 00196 00197 for(theta=EmcID::getTHETA_ENDCAP_MIN(); 00198 theta!=EmcID::getTHETA_ENDCAP_MAX()+1; 00199 theta++){ 00200 cout<<"|"; 00201 for(phi=(EmcID::getPHI_ENDCAP_MAX(theta)+1)/2; 00202 phi!=EmcID::getPHI_ENDCAP_MAX(theta)+1; 00203 phi++) { 00204 id=EmcID::crystal_id(module,theta,phi); 00205 ci_HitMap=aHitMap.find(id); 00206 if(ci_HitMap!=aHitMap.end()) { 00207 e=ci_HitMap->second.getEnergy(); 00208 ie=(int)(e*10); 00209 if(ie>9) { 00210 ie=9; 00211 } 00212 if((theta<4) && 00213 (phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00214 cout<<"*"; 00215 } 00216 cout<<ie; 00217 if((theta==0||theta==1)&&((phi+1)%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00218 cout<<"*"; 00219 } 00220 } 00221 else{ 00222 if((theta<4) && 00223 (phi%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00224 cout<<" "; 00225 } 00226 cout<<" "; 00227 if((theta==0||theta==1)&&((phi+1)%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0)){ 00228 cout<<" "; 00229 } 00230 } 00231 if((phi+1)%((EmcID::getPHI_ENDCAP_MAX(theta)+1)/16)==0){ 00232 cout<<"|"; 00233 } 00234 if(phi==3*(EmcID::getPHI_ENDCAP_MAX(theta)+1)/4-1){ 00235 cout<<"|"; 00236 } 00237 } 00238 cout<<endl; 00239 } 00240 cout<<"+--------------------------------------------------------+"<<endl; 00241 00242 }
|