#include <ME.h>
Classes | |
struct | Header |
struct | Settings |
Public Types | |
enum | { iLmfLaserRun, iLmfLaserConfig, iLmfLaserPulse, iLmfLaserPrim, iLmfLaserPnPrim, iLmfTestPulseRun, iLmfTestPulseConfig, iLmfTestPulsePrim, iLmfTestPulsePnPrim, iSizeLmf } |
enum | { iAPD_FLAG, iAPD_MEAN, iAPD_RMS, iAPD_M3, iAPD_OVER_PNA_MEAN, iAPD_OVER_PNA_RMS, iAPD_OVER_PNA_M3, iAPD_OVER_PNB_MEAN, iAPD_OVER_PNB_RMS, iAPD_OVER_PNB_M3, iAPD_OVER_PN_MEAN, iAPD_OVER_PN_RMS, iAPD_OVER_PN_M3, iAPD_SHAPE_COR, iAPD_ALPHA, iAPD_BETA, iAPD_TIME_MEAN, iAPD_TIME_RMS, iAPD_TIME_M3, iAPD_TIME_NEVT, iSizeAPD } |
enum | { iPN_FLAG, iPN_MEAN, iPN_RMS, iPN_M3, iPNA_OVER_PNB_MEAN, iPNA_OVER_PNB_RMS, iPNA_OVER_PNB_M3, iSizePN } |
enum | { iMTQ_FIT_METHOD, iMTQ_AMPL, iMTQ_TIME, iMTQ_RISE, iMTQ_FWHM, iMTQ_FW20, iMTQ_FW80, iMTQ_SLIDING, iSizeMTQ } |
enum | { iTPAPD_FLAG, iTPAPD_MEAN, iTPAPD_RMS, iTPAPD_M3, iTPAPD_NEVT, iSizeTPAPD } |
enum | { iTPPN_GAIN, iTPPN_MEAN, iTPPN_RMS, iTPPN_M3, iSizeTPPN } |
enum | Color { iBlue = 0, iGreen, iRed, iIRed, iLED1, iLED2, iSizeC } |
typedef int | DCCid |
enum | EcalElec { iElectronicChannel = iSizeG, iHVChannel, iLVChannel, iSizeU } |
enum | EcalRegion { iEEM = 0, iEBM, iEBP, iEEP, iSizeE } |
enum | EcalUnit { iEcalRegion = 0, iSector, iLMRegion, iLMModule, iSuperCrystal, iCrystal, iSizeG } |
enum | Gain { iVfeGain12 = 1, iVfeGain6, iVfeGain1, iSizeVfeGain } |
typedef int | LMMid |
typedef int | LMRid |
enum | PN { iPNA = 0, iPNB } |
enum | PNGain { iPnGain1 = 0, iPnGain16, iSizePnGain } |
typedef int | PNid |
enum | RunType { iLaser = 0, iTestPulse, iSizeT } |
typedef unsigned long | Time |
typedef unsigned long long | TimeStamp |
enum | TUnit { iDay, iHour, iMinute, iSecond, iSizeTU } |
Public Member Functions | |
virtual | ~ME () |
Static Public Member Functions | |
static std::vector< int > | apdRefChannels (ME::LMMid ilmmod, ME::LMRid ilmr) |
static std::pair< int, int > | dccAndSide (int ilmr) |
static int | ecalRegion (int ilmr) |
static bool | isBarrel (int ilmr) |
static TString | lmdataPath (int lmr) |
static std::vector< ME::LMMid > | lmmodFromDcc (ME::DCCid idcc) |
static std::vector< ME::LMMid > | lmmodFromLmr (ME::LMRid ilmr) |
static int | lmr (int idcc, int iside) |
static MEChannel * | lmrTree (int ilmr) |
static std::vector< ME::DCCid > | memFromDcc (ME::DCCid idcc) |
static std::pair< ME::DCCid, ME::DCCid > | memFromLmr (ME::LMRid ilmr) |
static TString | path () |
static std::pair< ME::DCCid, ME::PNid > | pn (ME::LMRid ilmr, ME::LMMid ilmmod, ME::PN ipn) |
static TString | primPath (int lmr) |
static void | regionAndSector (int ilmr, int &ireg, int &isect, int &idcc, int &iside) |
static MEChannel * | regTree (int ireg) |
static TString | rootFileName (ME::Header header, ME::Settings settings) |
static TString | runListName (int lmr, int type, int color) |
static TString | smName (int ireg, int ism) |
static TString | smName (int ilmr) |
static TString | smNameFromDcc (int idcc) |
static Time | time (float dt, Time t0, int tunit=iHour) |
static Time | time_high (TimeStamp t) |
static Time | time_low (TimeStamp t) |
static std::vector< Time > | timeDiff (Time t1, Time t2, short int &sign) |
static float | timeDiff (Time t1, Time t0, int tunit=iHour) |
Static Public Attributes | |
static std::vector< MEChannel * > | _trees = std::vector<MEChannel*>(4,(MEChannel*)0) |
static TString | APDPrimVar [iSizeAPD] |
static TString | color [iSizeC] |
static TString | granularity [iSizeG] |
static const TimeStamp | kLowMask = 0xFFFFFFFF |
static TString | MTQPrimVar [iSizeMTQ] |
static TString | PNPrimVar [iSizePN] |
static TString | region [4] |
static TString | TPAPDPrimVar [iSizeTPAPD] |
static TString | TPPNPrimVar [iSizeTPPN] |
static TString | type [iSizeT] |
static bool | useElectronicNumbering = false |
typedef unsigned long long ME::TimeStamp |
anonymous enum |
anonymous enum |
Definition at line 103 of file ME.h.
{ iAPD_FLAG, iAPD_MEAN, iAPD_RMS, iAPD_M3, iAPD_OVER_PNA_MEAN, iAPD_OVER_PNA_RMS, iAPD_OVER_PNA_M3, iAPD_OVER_PNB_MEAN, iAPD_OVER_PNB_RMS, iAPD_OVER_PNB_M3, iAPD_OVER_PN_MEAN, iAPD_OVER_PN_RMS, iAPD_OVER_PN_M3, iAPD_SHAPE_COR, iAPD_ALPHA, iAPD_BETA, iAPD_TIME_MEAN, iAPD_TIME_RMS, iAPD_TIME_M3, iAPD_TIME_NEVT, iSizeAPD };
anonymous enum |
anonymous enum |
anonymous enum |
anonymous enum |
Definition at line 131 of file ME.h.
{ iTPPN_GAIN, iTPPN_MEAN, iTPPN_RMS, iTPPN_M3, iSizeTPPN };
enum ME::Color |
enum ME::EcalElec |
enum ME::EcalRegion |
enum ME::EcalUnit |
Definition at line 18 of file ME.h.
{ iEcalRegion=0, iSector, iLMRegion, iLMModule, iSuperCrystal, iCrystal, iSizeG };
enum ME::Gain |
Definition at line 71 of file ME.h.
{ iVfeGain12=1, iVfeGain6, iVfeGain1, iSizeVfeGain };
enum ME::PNGain |
Definition at line 72 of file ME.h.
{ iPnGain1=0, iPnGain16, iSizePnGain };
enum ME::RunType |
Definition at line 69 of file ME.h.
{ iLaser=0, iTestPulse, iSizeT };
enum ME::TUnit |
std::pair< int, int > ME::dccAndSide | ( | int | ilmr | ) | [static] |
Definition at line 313 of file ME.cc.
Referenced by MEEBGeom::lmmodFromLmr(), MEEBGeom::memFromLmr(), and MEChannel::oneLine().
{ int idcc=0; int side=0; int ireg = ecalRegion( ilmr ); if( ireg==iEEM ) ilmr-=82; else if( ireg==iEBP ) ilmr-=36; else if( ireg==iEEP ) ilmr-=72; if( ireg==iEEM || ireg==iEEP ) { assert( ilmr>=1 && ilmr<=10 ); side = 0; idcc = ilmr; if( ilmr>=9 ) idcc--; if( ilmr==9 ) side=1; } else { assert( ilmr>=1 && ilmr<=36 ); idcc = (ilmr-1)/2+1; side = (ilmr-1)%2; } if( ireg>iEEM ) idcc+=9; if( ireg>iEBM ) idcc+=18; if( ireg>iEBP ) idcc+=18; // idcc += 600; return std::pair< int,int >( idcc, side ); }
int ME::ecalRegion | ( | int | ilmr | ) | [static] |
bool ME::isBarrel | ( | int | ilmr | ) | [static] |
TString ME::lmdataPath | ( | int | lmr | ) | [static] |
Definition at line 62 of file ME.cc.
References smName().
{ TString out_(getenv("MELMDAT")); out_ += "/"; out_ += ME::smName(lmr); out_ += "/"; return out_; }
std::vector< int > ME::lmmodFromDcc | ( | ME::DCCid | idcc | ) | [static] |
Definition at line 623 of file ME.cc.
Referenced by EcalLaserAnalyzer::EcalLaserAnalyzer(), EcalLaserAnalyzer2::EcalLaserAnalyzer2(), and EcalTestPulseAnalyzer::EcalTestPulseAnalyzer().
{ std::vector<int> vec; for( int iside=0; iside<=1; iside++ ) { int ilmr = lmr( idcc, iside ); if( ilmr<0 ) continue; bool isBarrel_ = isBarrel( ilmr ); std::vector< int > vec_ = lmmodFromLmr( ilmr ); for( unsigned ii=0; ii<vec_.size(); ii++ ) { int ilmmod_ = vec_[ii]; if( !isBarrel_ ) { // special case for Julie if( ilmmod_==18 && iside==1 ) ilmmod_=20; if( ilmmod_==19 && iside==1 ) ilmmod_=21; } vec.push_back( ilmmod_ ); } } return vec; }
int ME::lmr | ( | int | idcc, |
int | iside | ||
) | [static] |
Definition at line 261 of file ME.cc.
Referenced by MELaserPrim::MELaserPrim(), and rootFileName().
{ int ilmr=0; assert( side==0 || side==1 ); if( idcc>600 ) idcc-=600; assert( idcc>=1 && idcc<=54 ); int ireg; if( idcc<=9 ) ireg = iEEM; else { idcc -= 9; if( idcc<=18 ) ireg = iEBM; else { idcc -= 18; if( idcc<=18 ) ireg = iEBP; else { idcc -= 18; if( idcc<=9 ) ireg = iEEP; else abort(); } } } if( ireg==iEEM || ireg==iEEP ) { if( side==1 && idcc!=8 ) { return -1; } ilmr = idcc; if( idcc==9 ) ilmr++; if( idcc==8 && side==1 ) ilmr++; } else if( ireg==iEBM || ireg==iEBP ) { ilmr = 2*(idcc-1) + side + 1; } else abort(); if( ireg==iEBP ) ilmr+=36; else if( ireg==iEEP ) ilmr+=72; else if( ireg==iEEM ) ilmr+=82; return ilmr; }
MEChannel * ME::lmrTree | ( | int | ilmr | ) | [static] |
Definition at line 435 of file ME.cc.
References MEChannel::getDescendant().
{ return regTree( ecalRegion( ilmr ) )->getDescendant( iLMRegion, ilmr ); }
std::vector< int > ME::memFromDcc | ( | ME::DCCid | idcc | ) | [static] |
Definition at line 608 of file ME.cc.
Referenced by EcalTestPulseAnalyzer::EcalTestPulseAnalyzer(), and TMem::init().
{ std::vector<int> vec; for( int iside=0; iside<=1; iside++ ) { int ilmr = lmr( idcc, iside ); if( ilmr<0 ) continue; std::pair< int, int > mem_ = memFromLmr( ilmr ); vec.push_back( mem_.first ); vec.push_back( mem_.second ); } return vec; }
Referenced by TMem::Mem().
TString ME::path | ( | ) | [static] |
static std::pair<ME::DCCid,ME::PNid> ME::pn | ( | ME::LMRid | ilmr, |
ME::LMMid | ilmmod, | ||
ME::PN | ipn | ||
) | [static] |
Referenced by MELaserPrim::fillHistograms().
TString ME::primPath | ( | int | lmr | ) | [static] |
Definition at line 72 of file ME.cc.
References smName().
{ TString out_(getenv("MESTORE")); out_ += "/"; out_ += ME::smName(lmr); out_ += "/"; return out_; }
void ME::regionAndSector | ( | int | ilmr, |
int & | ireg, | ||
int & | isect, | ||
int & | idcc, | ||
int & | iside | ||
) | [static] |
Definition at line 348 of file ME.cc.
Referenced by MEGeom::getBoundary(), MEGeom::getHist(), MELaserPrim::MELaserPrim(), and smName().
{ ireg = ecalRegion( ilmr ); std::pair< int, int > ipair_ = dccAndSide( ilmr ); idcc = ipair_.first; side = ipair_.second; ism = 0; if( ireg==iEEM || ireg==iEEP ) { if( idcc>600 ) idcc-=600; // also works with FEDids if( idcc>=1 && idcc<=9 ) { ism = 6+idcc; if( ism>9 ) ism-=9; ism+=9; } else if( idcc>=46 && idcc<=54 ) { ism = idcc-46+7; if( ism>9 ) ism-=9; } else abort(); } else if( ireg==iEBM || ireg==iEBP ) { if( idcc>600 ) idcc-=600; // also works with FEDids assert( idcc>=10 && idcc<=45 ); ism=idcc-9; if( ism>18 ) ism-=18; else ism+=18; } else abort(); }
MEChannel * ME::regTree | ( | int | ireg | ) | [static] |
Definition at line 441 of file ME.cc.
References MEEEGeom::crystal(), MEEBGeom::crystal_channel(), MEEBGeom::electronic_channel(), MEChannel::getDaughter(), MEEBGeom::globalCoord(), MEEBGeom::lm_channel(), MEEEGeom::lmmod(), MEEEGeom::lmr(), MEEBGeom::lmr(), MEEEGeom::sc(), MEEEGeom::sm(), and MEEBGeom::tt_channel().
{ assert( ireg>=iEEM && ireg<=iEEP ); if( _trees[ireg]!=0 ) return _trees[ireg]; int iEcalRegion_ = ireg; int iSector_ = 0; int iLMRegion_ = 0; int iLMModule_ = 0; int iSuperCrystal_ = 0; int iCrystal_ = 0; MEChannel* leaf_(0); MEChannel* tree_(0); if( iEcalRegion_==iEBM || iEcalRegion_==iEBP ) { for( int isect=1; isect<=18; isect++ ) { iSector_ = isect; if( iEcalRegion_==iEBM ) iSector_+=18; if( _trees[iEcalRegion_]==0 ) { // std::cout << "Building the tree of crystals -- " // << ME::region[iEcalRegion_]; _trees[iEcalRegion_] = new MEChannel( 0, 0, iEcalRegion_, 0 ); } tree_=_trees[iEcalRegion_]; for( int iX=0; iX<17; iX++ ) { for( int iY=0; iY<4; iY++ ) { iSuperCrystal_ = MEEBGeom::tt_channel( iX, iY ); iLMModule_ = MEEBGeom::lm_channel( iX, iY ); for( int jx=0; jx<5; jx++ ) { for( int jy=0; jy<5; jy++ ) { int ix=5*iX+jx; int iy=5*iY+jy; if( useElectronicNumbering ) { iCrystal_ = MEEBGeom::electronic_channel(ix,iy); } else { iCrystal_ = MEEBGeom::crystal_channel(ix,iy); } MEEBGeom::EtaPhiCoord globalCoord = MEEBGeom::globalCoord( iSector_, ix, iy ); int ieta = globalCoord.first; int iphi = globalCoord.second; iLMRegion_ = MEEBGeom::lmr( ieta, iphi ); leaf_ = tree_; leaf_ = leaf_->getDaughter( ieta, iphi, iSector_ ); leaf_ = leaf_->getDaughter( ieta, iphi, iLMRegion_ ); leaf_ = leaf_->getDaughter( ieta, iphi, iLMModule_ ); leaf_ = leaf_->getDaughter( ieta, iphi, iSuperCrystal_ ); leaf_ = leaf_->getDaughter( ieta, iphi, iCrystal_ ); } } } } } } else if( iEcalRegion_==iEEM || iEcalRegion_==iEEP ) { int iz=1; if( iEcalRegion_==iEEM ) iz=-1; if( _trees[iEcalRegion_]==0 ) { // std::cout << "Building the tree of crystals -- " // << ME::region[iEcalRegion_]; _trees[iEcalRegion_] = new MEChannel( 0, 0, iEcalRegion_, 0 ); } tree_=_trees[iEcalRegion_]; for( int ilmr=72; ilmr<=92; ilmr++ ) // force the order of Monitoring Regions { if( ecalRegion( ilmr )!=iEcalRegion_ ) continue; for( int ilmm=1; ilmm<=19; ilmm++ ) // force the order of Monitoring Modules { for( int iXX=1; iXX<=10; iXX++ ) { for( int iside=1; iside<=2; iside++ ) // symmetrize wrt y-axis { int iX=iXX; if( iside==2 ) iX = 20-iXX+1; for( int iY=1; iY<=20; iY++ ) { //int iSector_ = MEEEGeom::sector( iX, iY ); int iSector_ = MEEEGeom::sm( iX, iY, iz ); if( iSector_<0 ) continue; iLMRegion_ = MEEEGeom::lmr( iX, iY, iz ); if( iLMRegion_!=ilmr ) continue; iLMModule_ = MEEEGeom::lmmod( iX, iY ); if( iLMModule_!=ilmm ) continue; iSuperCrystal_ = MEEEGeom::sc( iX, iY ); for( int jxx=1; jxx<=5; jxx++ ) { int jx = jxx; // symmetrize... if( iside==2 ) jx = 5-jxx+1; for( int jy=1; jy<=5; jy++ ) { int ix = 5*(iX-1)+jx; int iy = 5*(iY-1)+jy; iCrystal_ = MEEEGeom::crystal( ix, iy ); if( iCrystal_<0 ) continue; leaf_ = tree_; leaf_ = leaf_->getDaughter( ix, iy, iSector_ ); leaf_ = leaf_->getDaughter( ix, iy, iLMRegion_ ); leaf_ = leaf_->getDaughter( ix, iy, iLMModule_ ); leaf_ = leaf_->getDaughter( ix, iy, iSuperCrystal_ ); leaf_ = leaf_->getDaughter( ix, iy, iCrystal_ ); } } } } } } } } // std::cout << ".... done" << std::endl; return _trees[iEcalRegion_]; }
TString ME::rootFileName | ( | ME::Header | header, |
ME::Settings | settings | ||
) | [static] |
Definition at line 88 of file ME.cc.
References iLaser, iTestPulse, lmr(), and smName().
{ // get the laser monitoring region and super-module int lmr_ = ME::lmr( header.dcc, header.side ); TString outfile_ = primPath( lmr_ ); outfile_ += "LMF_"; outfile_ += ME::smName( lmr_ ); outfile_ += "_"; outfile_ += header.side; if( settings.type==ME::iLaser ) { switch( settings.wavelength ) { case iBlue: outfile_ += "_BlueLaser"; break; case iGreen: outfile_ += "_GreenLaser"; break; case iRed: outfile_ += "_RedLaser"; break; case iIRed: outfile_ += "_IRedLaser"; break; default: break; } } else if( settings.type==ME::iTestPulse ) { outfile_ += "_testPulse"; } outfile_ += "_"; outfile_ += header.rundir.c_str(); outfile_ += "_TS"; outfile_ += header.ts_beg; outfile_ += ".root"; return outfile_; }
TString ME::runListName | ( | int | lmr, |
int | type, | ||
int | color | ||
) | [static] |
Definition at line 118 of file ME.cc.
References iBlue, iGreen, iIRed, and iRed.
{ TString outfile_ = primPath( lmr ); if( type==iLaser ) { outfile_ += "runlist_"; switch( color ) { case ME::iBlue: outfile_+="Blue_"; break; case ME::iGreen: outfile_+="Red_"; break; case ME::iRed: outfile_+="Red_"; break; case ME::iIRed: outfile_+="IRed_"; break; default: abort(); } outfile_ += "Laser"; } else if( type==iTestPulse ) { outfile_ += "runlist_Test_Pulse"; } return outfile_; }
TString ME::smName | ( | int | ireg, |
int | ism | ||
) | [static] |
Definition at line 387 of file ME.cc.
References iEBM, iEBP, iEEM, iEEP, ecalpyutils::ism(), and dbtoconf::out.
{ TString out; if( ireg==ME::iEEM || ireg==ME::iEEP ) { assert( ism>=1 && ism<=18 ); out = "EE+"; if( ireg==ME::iEEM ) out = "EE-"; if( ism>9 ) ism -= 9; out += ism; } else if( ireg==ME::iEBM || ireg==ME::iEBP ) { assert( ism>=1 && ism<=36 ); out = "EB+"; if( ism>18 ) { out = "EB-"; ism -= 18; } out += ism; } else abort(); return out; }
TString ME::smName | ( | int | ilmr | ) | [static] |
Definition at line 415 of file ME.cc.
References dbtoconf::out, and regionAndSector().
Referenced by lmdataPath(), MELaserPrim::MELaserPrim(), MEChannel::oneLine(), primPath(), and rootFileName().
{ TString out; int reg_(0); int sm_(0); int dcc_(0); int side_(0); ME::regionAndSector( ilmr, reg_, sm_, dcc_, side_ ); out = smName( reg_, sm_ ); return out; }
TString ME::smNameFromDcc | ( | int | idcc | ) | [static] |
Definition at line 208 of file ME.cc.
References gather_cfg::cout, and dt.
{ short int sign = 1; if( dt<0 ) sign = -1; float t_ = sign*dt; switch( tunit ) { case iDay: t_*=86400; break; case iHour: t_*=3600; break; case iMinute: t_*=60; break; }; ME::Time it_ = static_cast<ME::Time>(t_); std::cout << "dt/it/t0/ " << dt << "/" << it_ << "/" << t0 << std::endl; if( sign==1 ) return t0+it_; else return t0-it_; }
Definition at line 238 of file ME.cc.
Referenced by MELaserPrim::fillHistograms().
Definition at line 232 of file ME.cc.
References cond::time::kLowMask(), and lumiQTWidget::t.
Referenced by MELaserPrim::fillHistograms().
Definition at line 142 of file ME.cc.
{ sign = 1; // Time t1 = time_high( T1 ); // Time t2 = time_high( T2 ); Time dt_s(0); if( t1>t2 ) { dt_s = t1-t2; } else { sign = -1; dt_s = t2-t1; } Time dt_min = dt_s/60; Time n_s = dt_s-dt_min*60; Time dt_h = dt_min/60; Time n_min = dt_min-dt_h*60; Time dt_day = dt_h/24; Time n_h = dt_h-dt_day*24; Time n_day = dt_day; std::vector< Time > vec_; vec_.push_back( n_day ); vec_.push_back( n_h ); vec_.push_back( n_min ); vec_.push_back( n_s ); return vec_; }
std::vector< MEChannel * > ME::_trees = std::vector<MEChannel*>(4,(MEChannel*)0) [static] |
TString ME::APDPrimVar [static] |
{ "FLAG", "MEAN", "RMS", "M3", "APD_OVER_PNA_MEAN", "APD_OVER_PNA_RMS", "APD_OVER_PNA_M3", "APD_OVER_PNB_MEAN", "APD_OVER_PNB_RMS", "APD_OVER_PNB_M3", "APD_OVER_PN_MEAN", "APD_OVER_PN_RMS", "APD_OVER_PN_M3", "SHAPE_COR", "ALPHA", "BETA", "TIME_MEAN", "TIME_RMS", "TIME_M3", "TIME_NEVT" }
TString ME::color [static] |
TString ME::granularity [static] |
const ME::TimeStamp ME::kLowMask = 0xFFFFFFFF [static] |
TString ME::MTQPrimVar [static] |
TString ME::PNPrimVar [static] |
TString ME::region [static] |
{ "EE-", "EB-", "EB+", "EE+" }
Definition at line 57 of file ME.h.
Referenced by MEChannel::oneLine(), and MEChannel::oneWord().
TString ME::TPAPDPrimVar [static] |
TString ME::TPPNPrimVar [static] |
TString ME::type [static] |
bool ME::useElectronicNumbering = false [static] |