CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
ME Class Reference

#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::LMMidlmmodFromDcc (ME::DCCid idcc)
 
static std::vector< ME::LMMidlmmodFromLmr (ME::LMRid ilmr)
 
static int lmr (int idcc, int iside)
 
static MEChannellmrTree (int ilmr)
 
static std::vector< ME::DCCidmemFromDcc (ME::DCCid idcc)
 
static std::pair< ME::DCCid, ME::DCCidmemFromLmr (ME::LMRid ilmr)
 
static TString path ()
 
static std::pair< ME::DCCid, ME::PNidpn (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 MEChannelregTree (int ireg)
 
static TString rootFileName (ME::Header header, ME::Settings settings)
 
static TString runListName (int lmr, int type, int color)
 
static TString smName (int ilmr)
 
static TString smName (int ireg, int ism)
 
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< TimetimeDiff (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*)nullptr)
 
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
 

Detailed Description

Definition at line 11 of file ME.h.

Member Typedef Documentation

typedef int ME::DCCid

Definition at line 42 of file ME.h.

typedef int ME::LMMid

Definition at line 44 of file ME.h.

typedef int ME::LMRid

Definition at line 43 of file ME.h.

typedef int ME::PNid

Definition at line 45 of file ME.h.

typedef unsigned long ME::Time

Definition at line 74 of file ME.h.

typedef unsigned long long ME::TimeStamp

Definition at line 75 of file ME.h.

Member Enumeration Documentation

anonymous enum
Enumerator
iLmfLaserRun 
iLmfLaserConfig 
iLmfLaserPulse 
iLmfLaserPrim 
iLmfLaserPnPrim 
iLmfTestPulseRun 
iLmfTestPulseConfig 
iLmfTestPulsePrim 
iLmfTestPulsePnPrim 
iSizeLmf 

Definition at line 91 of file ME.h.

anonymous enum
Enumerator
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 

Definition at line 103 of file ME.h.

anonymous enum
Enumerator
iPN_FLAG 
iPN_MEAN 
iPN_RMS 
iPN_M3 
iPNA_OVER_PNB_MEAN 
iPNA_OVER_PNB_RMS 
iPNA_OVER_PNB_M3 
iSizePN 

Definition at line 113 of file ME.h.

anonymous enum
Enumerator
iMTQ_FIT_METHOD 
iMTQ_AMPL 
iMTQ_TIME 
iMTQ_RISE 
iMTQ_FWHM 
iMTQ_FW20 
iMTQ_FW80 
iMTQ_SLIDING 
iSizeMTQ 

Definition at line 119 of file ME.h.

anonymous enum
Enumerator
iTPAPD_FLAG 
iTPAPD_MEAN 
iTPAPD_RMS 
iTPAPD_M3 
iTPAPD_NEVT 
iSizeTPAPD 

Definition at line 126 of file ME.h.

anonymous enum
Enumerator
iTPPN_GAIN 
iTPPN_MEAN 
iTPPN_RMS 
iTPPN_M3 
iSizeTPPN 

Definition at line 131 of file ME.h.

enum ME::Color
Enumerator
iBlue 
iGreen 
iRed 
iIRed 
iLED1 
iLED2 
iSizeC 

Definition at line 70 of file ME.h.

70 { iBlue=0, iGreen, iRed, iIRed, iLED1, iLED2, iSizeC };
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:70
enum ME::EcalElec
Enumerator
iElectronicChannel 
iHVChannel 
iLVChannel 
iSizeU 

Definition at line 21 of file ME.h.

enum ME::EcalRegion
Enumerator
iEEM 
iEBM 
iEBP 
iEEP 
iSizeE 

Definition at line 16 of file ME.h.

16 { iEEM=0, iEBM, iEBP, iEEP, iSizeE };
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
enum ME::EcalUnit
Enumerator
iEcalRegion 
iSector 
iLMRegion 
iLMModule 
iSuperCrystal 
iCrystal 
iSizeG 

Definition at line 18 of file ME.h.

enum ME::Gain
Enumerator
iVfeGain12 
iVfeGain6 
iVfeGain1 
iSizeVfeGain 

Definition at line 71 of file ME.h.

enum ME::PN
Enumerator
iPNA 
iPNB 

Definition at line 46 of file ME.h.

46 { iPNA=0, iPNB };
Definition: ME.h:46
Definition: ME.h:46
enum ME::PNGain
Enumerator
iPnGain1 
iPnGain16 
iSizePnGain 

Definition at line 72 of file ME.h.

enum ME::RunType
Enumerator
iLaser 
iTestPulse 
iSizeT 

Definition at line 69 of file ME.h.

69 { iLaser=0, iTestPulse, iSizeT };
Definition: ME.h:69
Definition: ME.h:69
enum ME::TUnit
Enumerator
iDay 
iHour 
iMinute 
iSecond 
iSizeTU 

Definition at line 136 of file ME.h.

Definition: ME.h:136
Definition: ME.h:136

Constructor & Destructor Documentation

virtual ME::~ME ( )
inlinevirtual

Definition at line 154 of file ME.h.

154 {}

Member Function Documentation

std::vector< int > ME::apdRefChannels ( ME::LMMid  ilmmod,
ME::LMRid  ilmr 
)
static

Definition at line 588 of file ME.cc.

References MEEBGeom::apdRefChannels(), MEEEGeom::apdRefChannels(), and GeomDetEnumerators::isBarrel().

Referenced by EcalLaserAnalyzer2::setGeomEB(), EcalLaserAnalyzer::setGeomEB(), EcalLaserAnalyzer2::setGeomEE(), and EcalLaserAnalyzer::setGeomEE().

589 {
590  if( isBarrel( ilmr ) )
591  return MEEBGeom::apdRefChannels( ilmmod );
592  else
593  return MEEEGeom::apdRefChannels( ilmmod );
594  return std::vector< int>();
595 }
static std::vector< int > apdRefChannels(int ilmmod)
Definition: MEEBGeom.cc:551
static bool isBarrel(int ilmr)
Definition: ME.cc:569
static std::vector< int > apdRefChannels(int ilmmod)
Definition: MEEEGeom.cc:1097
std::pair< int, int > ME::dccAndSide ( int  ilmr)
static

Definition at line 313 of file ME.cc.

Referenced by MEEBGeom::lmmodFromLmr(), MEEEGeom::lmmodFromLmr(), MEEBGeom::memFromLmr(), and MEChannel::oneLine().

314 {
315  int idcc=0;
316  int side=0;
317 
318  int ireg = ecalRegion( ilmr );
319  if( ireg==iEEM ) ilmr-=82;
320  else if( ireg==iEBP ) ilmr-=36;
321  else if( ireg==iEEP ) ilmr-=72;
322 
323  if( ireg==iEEM || ireg==iEEP )
324  {
325  assert( ilmr>=1 && ilmr<=10 );
326  side = 0;
327  idcc = ilmr;
328  if( ilmr>=9 ) idcc--;
329  if( ilmr==9 ) side=1;
330  }
331  else
332  {
333  assert( ilmr>=1 && ilmr<=36 );
334  idcc = (ilmr-1)/2+1;
335  side = (ilmr-1)%2;
336  }
337 
338  if( ireg>iEEM ) idcc+=9;
339  if( ireg>iEBM ) idcc+=18;
340  if( ireg>iEBP ) idcc+=18;
341 
342  // idcc += 600;
343 
344  return std::pair< int,int >( idcc, side );
345 }
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
static int ecalRegion(int ilmr)
Definition: ME.cc:249
Definition: ME.h:16
int ME::ecalRegion ( int  ilmr)
static

Definition at line 249 of file ME.cc.

250 {
251  assert( ilmr>0 && ilmr<=92 );
252  if( ilmr<=36 ) return iEBM;
253  ilmr-=36;
254  if( ilmr<=36 ) return iEBP;
255  ilmr-=36;
256  if( ilmr<=10 ) return iEEP;
257  return iEEM;
258 }
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
bool ME::isBarrel ( int  ilmr)
static

Definition at line 569 of file ME.cc.

570 {
571  int reg_ = ecalRegion( ilmr );
572  if ( reg_==iEEM || reg_==iEEP ) return false;
573  else if( reg_==iEBM || reg_==iEBP ) return true;
574  else abort();
575  return true;
576 }
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
static int ecalRegion(int ilmr)
Definition: ME.cc:249
Definition: ME.h:16
TString ME::lmdataPath ( int  lmr)
static

Definition at line 62 of file ME.cc.

References smName().

63 {
64  TString out_(getenv("MELMDAT"));
65  out_ += "/";
66  out_ += ME::smName(lmr);
67  out_ += "/";
68  return out_;
69 }
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString smName(int ilmr)
Definition: ME.cc:415
std::vector< int > ME::lmmodFromDcc ( ME::DCCid  idcc)
static

Definition at line 623 of file ME.cc.

References cuy::ii, and GeomDetEnumerators::isBarrel().

Referenced by EcalLaserAnalyzer::EcalLaserAnalyzer(), EcalLaserAnalyzer2::EcalLaserAnalyzer2(), and EcalTestPulseAnalyzer::EcalTestPulseAnalyzer().

624 {
625  std::vector<int> vec;
626  for( int iside=0; iside<=1; iside++ )
627  {
628  int ilmr = lmr( idcc, iside );
629  if( ilmr<0 ) continue;
630  bool isBarrel_ = isBarrel( ilmr );
631  std::vector< int > vec_ = lmmodFromLmr( ilmr );
632  for( unsigned ii=0; ii<vec_.size(); ii++ )
633  {
634  int ilmmod_ = vec_[ii];
635  if( !isBarrel_ )
636  {
637  // special case for Julie
638  if( ilmmod_==18 && iside==1 ) ilmmod_=20;
639  if( ilmmod_==19 && iside==1 ) ilmmod_=21;
640  }
641  vec.push_back( ilmmod_ );
642  }
643  }
644  return vec;
645 }
static bool isBarrel(int ilmr)
Definition: ME.cc:569
ii
Definition: cuy.py:590
static std::vector< ME::LMMid > lmmodFromLmr(ME::LMRid ilmr)
Definition: ME.cc:598
static int lmr(int idcc, int iside)
Definition: ME.cc:261
std::vector< int > ME::lmmodFromLmr ( ME::LMRid  ilmr)
static

Definition at line 598 of file ME.cc.

References GeomDetEnumerators::isBarrel(), MEEBGeom::lmmodFromLmr(), and MEEEGeom::lmmodFromLmr().

599 {
600  if( isBarrel(ilmr) )
601  return MEEBGeom::lmmodFromLmr( ilmr );
602  else
603  return MEEEGeom::lmmodFromLmr( ilmr );
604  return std::vector<int>();
605 }
static bool isBarrel(int ilmr)
Definition: ME.cc:569
static std::vector< int > lmmodFromLmr(int ilmr)
Definition: MEEEGeom.cc:948
static std::vector< int > lmmodFromLmr(int ilmr)
Definition: MEEBGeom.cc:507
int ME::lmr ( int  idcc,
int  iside 
)
static

Definition at line 261 of file ME.cc.

Referenced by MELaserPrim::MELaserPrim(), and rootFileName().

262 {
263  int ilmr=0;
264 
265  assert( side==0 || side==1 );
266 
267  if( idcc>600 ) idcc-=600;
268  assert( idcc>=1 && idcc<=54 );
269  int ireg;
270  if( idcc<=9 ) ireg = iEEM;
271  else
272  {
273  idcc -= 9;
274  if( idcc<=18 ) ireg = iEBM;
275  else
276  {
277  idcc -= 18;
278  if( idcc<=18 ) ireg = iEBP;
279  else
280  {
281  idcc -= 18;
282  if( idcc<=9 ) ireg = iEEP;
283  else
284  abort();
285  }
286  }
287  }
288  if( ireg==iEEM || ireg==iEEP )
289  {
290  if( side==1 && idcc!=8 )
291  {
292  return -1;
293  }
294  ilmr = idcc;
295  if( idcc==9 ) ilmr++;
296  if( idcc==8 && side==1 ) ilmr++;
297  }
298  else if( ireg==iEBM || ireg==iEBP )
299  {
300  ilmr = 2*(idcc-1) + side + 1;
301  }
302  else
303  abort();
304 
305  if( ireg==iEBP ) ilmr+=36;
306  else if( ireg==iEEP ) ilmr+=72;
307  else if( ireg==iEEM ) ilmr+=82;
308 
309  return ilmr;
310 }
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
MEChannel * ME::lmrTree ( int  ilmr)
static

Definition at line 435 of file ME.cc.

References MEChannel::getDescendant().

436 {
437  return regTree( ecalRegion( ilmr ) )->getDescendant( iLMRegion, ilmr );
438 }
MEChannel * getDescendant(int ig, int ii)
Definition: MEChannel.cc:135
static int ecalRegion(int ilmr)
Definition: ME.cc:249
static MEChannel * regTree(int ireg)
Definition: ME.cc:441
std::vector< int > ME::memFromDcc ( ME::DCCid  idcc)
static

Definition at line 608 of file ME.cc.

Referenced by EcalTestPulseAnalyzer::EcalTestPulseAnalyzer(), and TMem::init().

609 {
610  std::vector<int> vec;
611  for( int iside=0; iside<=1; iside++ )
612  {
613  int ilmr = lmr( idcc, iside );
614  if( ilmr<0 ) continue;
615  std::pair< int, int > mem_ = memFromLmr( ilmr );
616  vec.push_back( mem_.first );
617  vec.push_back( mem_.second );
618  }
619  return vec;
620 }
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
Definition: ME.cc:579
static int lmr(int idcc, int iside)
Definition: ME.cc:261
std::pair< int, int > ME::memFromLmr ( ME::LMRid  ilmr)
static

Definition at line 579 of file ME.cc.

References GeomDetEnumerators::isBarrel(), MEEBGeom::memFromLmr(), and MEEEGeom::memFromLmr().

Referenced by TMem::Mem().

580 {
581  if( isBarrel( ilmr ) )
582  return MEEBGeom::memFromLmr( ilmr );
583  else
584  return MEEEGeom::memFromLmr( ilmr );
585  return std::pair<int,int>();
586 }
static std::pair< int, int > memFromLmr(int ilmr)
Definition: MEEEGeom.cc:904
static bool isBarrel(int ilmr)
Definition: ME.cc:569
static std::pair< int, int > memFromLmr(int ilmr)
Definition: MEEBGeom.cc:499
TString ME::path ( )
static

Definition at line 82 of file ME.cc.

83 {
84  return TString(getenv("MUSECAL"))+"/";
85 }
std::pair< int, int > ME::pn ( ME::LMRid  ilmr,
ME::LMMid  ilmmod,
ME::PN  ipn 
)
static

Definition at line 648 of file ME.cc.

References MEEEGeom::dee(), GeomDetEnumerators::isBarrel(), MEEBGeom::pn(), and MEEEGeom::pn().

Referenced by MELaserPrim::fillHistograms().

649 {
650  std::pair<int,int> pnpair_(0,0);
651  std::pair<int,int> mempair_ = memFromLmr(ilmr);
652  if( isBarrel( ilmr ) )
653  {
654  pnpair_=MEEBGeom::pn( ilmmod );
655  }
656  else
657  {
658  int dee_ = MEEEGeom::dee( ilmr );
659  pnpair_=MEEEGeom::pn( dee_, ilmmod );
660  }
661  int mem_(0);
662  int pn_(0);
663  if( ipn==iPNA )
664  {
665  mem_=mempair_.first;
666  pn_=pnpair_.first;
667  }
668  else
669  {
670  mem_=mempair_.second;
671  pn_=pnpair_.second;
672  }
673  return std::pair<int,int>(mem_,pn_);
674 }
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
Definition: ME.cc:579
Definition: ME.h:46
static bool isBarrel(int ilmr)
Definition: ME.cc:569
static std::pair< int, int > pn(int ilmmod)
Definition: MEEBGeom.cc:479
static std::pair< int, int > pn(int dee, int ilmod)
Definition: MEEEGeom.cc:615
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:284
TString ME::primPath ( int  lmr)
static

Definition at line 72 of file ME.cc.

References smName().

73 {
74  TString out_(getenv("MESTORE"));
75  out_ += "/";
76  out_ += ME::smName(lmr);
77  out_ += "/";
78  return out_;
79 }
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString smName(int ilmr)
Definition: ME.cc:415
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().

349 {
350  ireg = ecalRegion( ilmr );
351 
352  std::pair< int, int > ipair_ = dccAndSide( ilmr );
353  idcc = ipair_.first;
354  side = ipair_.second;
355 
356  ism = 0;
357  if( ireg==iEEM || ireg==iEEP )
358  {
359  if( idcc>600 ) idcc-=600; // also works with FEDids
360  if( idcc>=1 && idcc<=9 )
361  {
362  ism = 6+idcc;
363  if( ism>9 ) ism-=9;
364  ism+=9;
365  }
366  else if( idcc>=46 && idcc<=54 )
367  {
368  ism = idcc-46+7;
369  if( ism>9 ) ism-=9;
370  }
371  else
372  abort();
373  }
374  else if( ireg==iEBM || ireg==iEBP )
375  {
376  if( idcc>600 ) idcc-=600; // also works with FEDids
377  assert( idcc>=10 && idcc<=45 );
378  ism=idcc-9;
379  if( ism>18 ) ism-=18;
380  else ism+=18;
381  }
382  else
383  abort();
384 }
Definition: ME.h:16
Definition: ME.h:16
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:313
Definition: ME.h:16
static int ecalRegion(int ilmr)
Definition: ME.cc:249
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Definition: ME.h:16
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(), MEEBGeom::lmr(), MEEEGeom::lmr(), MEEEGeom::sc(), MEEEGeom::sm(), and MEEBGeom::tt_channel().

442 {
443  assert( ireg>=iEEM && ireg<=iEEP );
444  if( _trees[ireg]!=nullptr ) return _trees[ireg];
445 
446  int iEcalRegion_ = ireg;
447  int iSector_ = 0;
448  int iLMRegion_ = 0;
449  int iLMModule_ = 0;
450  int iSuperCrystal_ = 0;
451  int iCrystal_ = 0;
452  MEChannel* leaf_(nullptr);
453  MEChannel* tree_(nullptr);
454 
455  if( iEcalRegion_==iEBM || iEcalRegion_==iEBP )
456  {
457  for( int isect=1; isect<=18; isect++ )
458  {
459  iSector_ = isect;
460  if( iEcalRegion_==iEBM ) iSector_+=18;
461  if( _trees[iEcalRegion_]==nullptr )
462  {
463  // std::cout << "Building the tree of crystals -- "
464  // << ME::region[iEcalRegion_];
465  _trees[iEcalRegion_] = new MEChannel( 0, 0, iEcalRegion_, nullptr );
466  }
467  tree_=_trees[iEcalRegion_];
468  for( int iX=0; iX<17; iX++ )
469  {
470  for( int iY=0; iY<4; iY++ )
471  {
472  iSuperCrystal_ = MEEBGeom::tt_channel( iX, iY );
473  iLMModule_ = MEEBGeom::lm_channel( iX, iY );
474  for( int jx=0; jx<5; jx++ )
475  {
476  for( int jy=0; jy<5; jy++ )
477  {
478  int ix=5*iX+jx;
479  int iy=5*iY+jy;
481  {
482  iCrystal_ = MEEBGeom::electronic_channel(ix,iy);
483  }
484  else
485  {
486  iCrystal_ = MEEBGeom::crystal_channel(ix,iy);
487  }
488  MEEBGeom::EtaPhiCoord globalCoord =
489  MEEBGeom::globalCoord( iSector_, ix, iy );
490  int ieta = globalCoord.first;
491  int iphi = globalCoord.second;
492  iLMRegion_ = MEEBGeom::lmr( ieta, iphi );
493  leaf_ = tree_;
494  leaf_ = leaf_->getDaughter( ieta, iphi, iSector_ );
495  leaf_ = leaf_->getDaughter( ieta, iphi, iLMRegion_ );
496  leaf_ = leaf_->getDaughter( ieta, iphi, iLMModule_ );
497  leaf_ = leaf_->getDaughter( ieta, iphi, iSuperCrystal_ );
498  leaf_ = leaf_->getDaughter( ieta, iphi, iCrystal_ );
499  }
500  }
501  }
502  }
503  }
504  }
505  else if( iEcalRegion_==iEEM || iEcalRegion_==iEEP )
506  {
507  int iz=1;
508  if( iEcalRegion_==iEEM ) iz=-1;
509  if( _trees[iEcalRegion_]==nullptr )
510  {
511  // std::cout << "Building the tree of crystals -- "
512  // << ME::region[iEcalRegion_];
513  _trees[iEcalRegion_] = new MEChannel( 0, 0, iEcalRegion_, nullptr );
514  }
515  tree_=_trees[iEcalRegion_];
516 
517  for( int ilmr=72; ilmr<=92; ilmr++ ) // force the order of Monitoring Regions
518  {
519  if( ecalRegion( ilmr )!=iEcalRegion_ ) continue;
520  for( int ilmm=1; ilmm<=19; ilmm++ ) // force the order of Monitoring Modules
521  {
522  for( int iXX=1; iXX<=10; iXX++ )
523  {
524  for( int iside=1; iside<=2; iside++ ) // symmetrize wrt y-axis
525  {
526  int iX=iXX;
527  if( iside==2 ) iX = 20-iXX+1;
528  for( int iY=1; iY<=20; iY++ )
529  {
530  //int iSector_ = MEEEGeom::sector( iX, iY );
531  int iSector_ = MEEEGeom::sm( iX, iY, iz );
532  if( iSector_<0 ) continue;
533  iLMRegion_ = MEEEGeom::lmr( iX, iY, iz );
534  if( iLMRegion_!=ilmr ) continue;
535  iLMModule_ = MEEEGeom::lmmod( iX, iY );
536  if( iLMModule_!=ilmm ) continue;
537  iSuperCrystal_ = MEEEGeom::sc( iX, iY );
538 
539  for( int jxx=1; jxx<=5; jxx++ )
540  {
541  int jx = jxx; // symmetrize...
542  if( iside==2 ) jx = 5-jxx+1;
543 
544  for( int jy=1; jy<=5; jy++ )
545  {
546  int ix = 5*(iX-1)+jx;
547  int iy = 5*(iY-1)+jy;
548  iCrystal_ = MEEEGeom::crystal( ix, iy );
549  if( iCrystal_<0 ) continue;
550  leaf_ = tree_;
551  leaf_ = leaf_->getDaughter( ix, iy, iSector_ );
552  leaf_ = leaf_->getDaughter( ix, iy, iLMRegion_ );
553  leaf_ = leaf_->getDaughter( ix, iy, iLMModule_ );
554  leaf_ = leaf_->getDaughter( ix, iy, iSuperCrystal_ );
555  leaf_ = leaf_->getDaughter( ix, iy, iCrystal_ );
556  }
557  }
558  }
559  }
560  }
561  }
562  }
563  }
564  // std::cout << ".... done" << std::endl;
565  return _trees[iEcalRegion_];
566 }
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:94
static int crystal(CrysCoord ix, CrysCoord iy)
Definition: MEEEGeom.cc:398
static bool useElectronicNumbering
Definition: ME.h:40
static int crystal_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:332
Definition: ME.h:16
std::pair< EBGlobalCoord, EBGlobalCoord > EtaPhiCoord
Definition: MEEBGeom.h:26
Definition: ME.h:16
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:121
static int lm_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:218
static int electronic_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:341
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:162
static int sm(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:83
Definition: ME.h:16
static int ecalRegion(int ilmr)
Definition: ME.cc:249
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:322
static std::vector< MEChannel * > _trees
Definition: ME.h:156
Definition: ME.h:16
static int sc(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:211
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:250
TString ME::rootFileName ( ME::Header  header,
ME::Settings  settings 
)
static

Definition at line 88 of file ME.cc.

References ME::Header::dcc, iLaser, iTestPulse, lmr(), ME::Header::rundir, ME::Header::side, smName(), ME::Header::ts_beg, ME::Settings::type, and ME::Settings::wavelength.

89 {
90  // get the laser monitoring region and super-module
91  int lmr_ = ME::lmr( header.dcc, header.side );
92  TString outfile_ = primPath( lmr_ );
93  outfile_ += "LMF_";
94  outfile_ += ME::smName( lmr_ );
95  outfile_ += "_"; outfile_ += header.side;
96  if( settings.type==ME::iLaser )
97  {
98  switch( settings.wavelength )
99  {
100  case iBlue: outfile_ += "_BlueLaser"; break;
101  case iGreen: outfile_ += "_GreenLaser"; break;
102  case iRed: outfile_ += "_RedLaser"; break;
103  case iIRed: outfile_ += "_IRedLaser"; break;
104  default: break;
105  }
106  }
107  else if( settings.type==ME::iTestPulse )
108  {
109  outfile_ += "_testPulse";
110  }
111  outfile_ += "_"; outfile_ += header.rundir.c_str();
112  outfile_ += "_TS"; outfile_ += header.ts_beg;
113  outfile_ += ".root";
114  return outfile_;
115 }
int dcc
Definition: ME.h:80
int wavelength
Definition: ME.h:86
TimeStamp ts_beg
Definition: ME.h:81
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:69
Definition: ME.h:70
int side
Definition: ME.h:80
std::string rundir
Definition: ME.h:80
int type
Definition: ME.h:86
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString primPath(int lmr)
Definition: ME.cc:72
Definition: ME.h:70
static TString smName(int ilmr)
Definition: ME.cc:415
TString ME::runListName ( int  lmr,
int  type,
int  color 
)
static

Definition at line 118 of file ME.cc.

References iBlue, iGreen, iIRed, and iRed.

119 {
120  TString outfile_ = primPath( lmr );
121  if( type==iLaser )
122  {
123  outfile_ += "runlist_";
124  switch( color )
125  {
126  case ME::iBlue: outfile_+="Blue_"; break;
127  case ME::iGreen: outfile_+="Red_"; break;
128  case ME::iRed: outfile_+="Red_"; break;
129  case ME::iIRed: outfile_+="IRed_"; break;
130  default: abort();
131  }
132  outfile_ += "Laser";
133  }
134  else if( type==iTestPulse )
135  {
136  outfile_ += "runlist_Test_Pulse";
137  }
138  return outfile_;
139 }
type
Definition: HCALResponse.h:21
Definition: ME.h:70
Definition: ME.h:70
Definition: ME.h:69
Definition: ME.h:70
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString primPath(int lmr)
Definition: ME.cc:72
static TString color[iSizeC]
Definition: ME.h:145
Definition: ME.h:70
TString ME::smName ( int  ilmr)
static

Definition at line 415 of file ME.cc.

References MillePedeFileConverter_cfg::out, regionAndSector(), and ecaldqm::smName().

Referenced by lmdataPath(), MELaserPrim::MELaserPrim(), MEChannel::oneLine(), primPath(), and rootFileName().

416 {
417  TString out;
418  int reg_(0);
419  int sm_(0);
420  int dcc_(0);
421  int side_(0);
422  ME::regionAndSector( ilmr, reg_, sm_, dcc_, side_ );
423  out = smName( reg_, sm_ );
424  return out;
425 }
static void regionAndSector(int ilmr, int &ireg, int &isect, int &idcc, int &iside)
Definition: ME.cc:348
static TString smName(int ilmr)
Definition: ME.cc:415
TString ME::smName ( int  ireg,
int  ism 
)
static

Definition at line 387 of file ME.cc.

References iEBM, iEBP, iEEM, iEEP, ecalpyutils::ism(), and MillePedeFileConverter_cfg::out.

388 {
389  TString out;
390  if( ireg==ME::iEEM || ireg==ME::iEEP )
391  {
392  assert( ism>=1 && ism<=18 );
393  out = "EE+";
394  if( ireg==ME::iEEM ) out = "EE-";
395  if( ism>9 ) ism -= 9;
396  out += ism;
397  }
398  else if( ireg==ME::iEBM || ireg==ME::iEBP )
399  {
400  assert( ism>=1 && ism<=36 );
401  out = "EB+";
402  if( ism>18 )
403  {
404  out = "EB-";
405  ism -= 18;
406  }
407  out += ism;
408  }
409  else
410  abort();
411  return out;
412 }
Definition: ME.h:16
Definition: ME.h:16
Definition: ME.h:16
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:56
Definition: ME.h:16
TString ME::smNameFromDcc ( int  idcc)
static

Definition at line 428 of file ME.cc.

References ecaldqm::smName().

429 {
430  int ilmr = lmr( idcc,0 );
431  return smName( ilmr );
432 }
static int lmr(int idcc, int iside)
Definition: ME.cc:261
static TString smName(int ilmr)
Definition: ME.cc:415
ME::Time ME::time ( float  dt,
Time  t0,
int  tunit = iHour 
)
static

Definition at line 208 of file ME.cc.

References gather_cfg::cout, dt, and Validation_hcalonly_cfi::sign.

209 {
210  short int sign = 1;
211  if( dt<0 ) sign = -1;
212  float t_ = sign*dt;
213  switch( tunit )
214  {
215  case iDay:
216  t_*=86400;
217  break;
218  case iHour:
219  t_*=3600;
220  break;
221  case iMinute:
222  t_*=60;
223  break;
224  };
225  ME::Time it_ = static_cast<ME::Time>(t_);
226  std::cout << "dt/it/t0/ " << dt << "/" << it_ << "/" << t0 << std::endl;
227  if( sign==1 ) return t0+it_;
228  else return t0-it_;
229 }
float dt
Definition: AMPTWrapper.h:126
unsigned long Time
Definition: ME.h:74
Definition: ME.h:136
Definition: ME.h:136
ME::Time ME::time_high ( TimeStamp  t)
static

Definition at line 238 of file ME.cc.

References iSizeE, and region.

Referenced by MELaserPrim::fillHistograms().

239 {
240  return static_cast<Time>(t>>32);
241 }
unsigned long Time
Definition: ME.h:74
ME::Time ME::time_low ( TimeStamp  t)
static

Definition at line 232 of file ME.cc.

References cond::time::kLowMask(), and lumiQTWidget::t.

Referenced by MELaserPrim::fillHistograms().

233 {
234  return static_cast<Time>(kLowMask&t);
235 }
unsigned long Time
Definition: ME.h:74
static const TimeStamp kLowMask
Definition: ME.h:76
std::vector< ME::Time > ME::timeDiff ( Time  t1,
Time  t2,
short int &  sign 
)
static

Definition at line 142 of file ME.cc.

143 {
144  sign = 1;
145  // Time t1 = time_high( T1 );
146  // Time t2 = time_high( T2 );
147  Time dt_s(0);
148  if( t1>t2 )
149  {
150  dt_s = t1-t2;
151  }
152  else
153  {
154  sign = -1;
155  dt_s = t2-t1;
156  }
157  Time dt_min = dt_s/60;
158  Time n_s = dt_s-dt_min*60;
159  Time dt_h = dt_min/60;
160  Time n_min = dt_min-dt_h*60;
161  Time dt_day = dt_h/24;
162  Time n_h = dt_h-dt_day*24;
163  Time n_day = dt_day;
164 
165 
166  std::vector< Time > vec_;
167  vec_.push_back( n_day );
168  vec_.push_back( n_h );
169  vec_.push_back( n_min );
170  vec_.push_back( n_s );
171 
172  return vec_;
173 }
unsigned long Time
Definition: ME.h:74
float ME::timeDiff ( Time  t1,
Time  t0,
int  tunit = iHour 
)
static

Definition at line 176 of file ME.cc.

References dt, objects.autophobj::float, Validation_hcalonly_cfi::sign, and genVertex_cff::t0.

177 {
178  float sign = 1.;
179  Time dt(0);
180  if( t1>t0 )
181  {
182  dt = t1-t0;
183  }
184  else
185  {
186  sign = -1.;
187  dt = t0-t1;
188  }
189  float dt_f = ((float) dt)*sign;
190  switch( tunit )
191  {
192  case iDay:
193  return dt_f/86400.;
194  break;
195  case iHour:
196  return dt_f/3600.;
197  break;
198  case iMinute:
199  return dt_f/60.;
200  break;
201  default:
202  return dt_f;
203  };
204  return 0;
205 }
float dt
Definition: AMPTWrapper.h:126
unsigned long Time
Definition: ME.h:74
Definition: ME.h:136
Definition: ME.h:136

Member Data Documentation

std::vector< MEChannel * > ME::_trees = std::vector<MEChannel*>(4,(MEChannel*)nullptr)
static

Definition at line 156 of file ME.h.

TString ME::APDPrimVar
static
Initial value:
= {
"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"
}

Definition at line 110 of file ME.h.

TString ME::color
static
Initial value:
= {
"Blue", "Green", "Red", "IRed", "LED1", "LED2"
}

Definition at line 145 of file ME.h.

Referenced by edmStreamStallGrapher.StreamInfoElement::unpack().

TString ME::granularity
static
Initial value:
= {
"R", "SM", "LMR", "LMM", "SC", "C"
}

Definition at line 60 of file ME.h.

Referenced by MEChannel::oneLine(), MEChannel::oneWord(), and MEChannel::print().

const ME::TimeStamp ME::kLowMask =0xFFFFFFFF
static

Definition at line 76 of file ME.h.

TString ME::MTQPrimVar
static
Initial value:
= {
"FIT_METHOD",
"MTQ_AMPL", "MTQ_TIME", "MTQ_RISE",
"MTQ_FWHM", "MTQ_FW20", "MTQ_FW80", "MTQ_SLIDING"
}

Definition at line 123 of file ME.h.

TString ME::PNPrimVar
static
Initial value:
= {
"FLAG", "MEAN", "RMS", "M3",
"PNA_OVER_PNB_MEAN", "PNA_OVER_PNB_RMS", "PNA_OVER_PNB_M3",
}

Definition at line 116 of file ME.h.

TString ME::region
static
Initial value:
= {
"EE-", "EB-", "EB+", "EE+"
}

Definition at line 57 of file ME.h.

Referenced by MEChannel::oneLine(), MEChannel::oneWord(), and time_high().

TString ME::TPAPDPrimVar
static
Initial value:
= {
"FLAG", "MEAN", "RMS", "M3", "NEVT"
}

Definition at line 128 of file ME.h.

TString ME::TPPNPrimVar
static
Initial value:
= {
"GAIN", "MEAN", "RMS", "M3"
}

Definition at line 133 of file ME.h.

TString ME::type
static
bool ME::useElectronicNumbering = false
static

Definition at line 40 of file ME.h.