CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::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 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] = {"Blue", "Green", "Red", "IRed", "LED1", "LED2"}
 
static TString granularity [iSizeG] = {"R", "SM", "LMR", "LMM", "SC", "C"}
 
static const TimeStamp kLowMask = 0xFFFFFFFF
 
static TString MTQPrimVar [iSizeMTQ]
 
static TString PNPrimVar [iSizePN]
 
static TString region [4] = {"EE-", "EB-", "EB+", "EE+"}
 
static TString TPAPDPrimVar [iSizeTPAPD] = {"FLAG", "MEAN", "RMS", "M3", "NEVT"}
 
static TString TPPNPrimVar [iSizeTPPN] = {"GAIN", "MEAN", "RMS", "M3"}
 
static TString type [iSizeT] = {"Laser", "TestPulse"}
 
static bool useElectronicNumbering = false
 

Detailed Description

Definition at line 11 of file ME.h.

Member Typedef Documentation

typedef int ME::DCCid

Definition at line 38 of file ME.h.

typedef int ME::LMMid

Definition at line 40 of file ME.h.

typedef int ME::LMRid

Definition at line 39 of file ME.h.

typedef int ME::PNid

Definition at line 41 of file ME.h.

typedef unsigned long ME::Time

Definition at line 68 of file ME.h.

typedef unsigned long long ME::TimeStamp

Definition at line 69 of file ME.h.

Member Enumeration Documentation

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

Definition at line 94 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 108 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 134 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 138 of file ME.h.

anonymous enum
Enumerator
iTPAPD_FLAG 
iTPAPD_MEAN 
iTPAPD_RMS 
iTPAPD_M3 
iTPAPD_NEVT 
iSizeTPAPD 

Definition at line 142 of file ME.h.

anonymous enum
Enumerator
iTPPN_GAIN 
iTPPN_MEAN 
iTPPN_RMS 
iTPPN_M3 
iSizeTPPN 

Definition at line 146 of file ME.h.

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

Definition at line 64 of file ME.h.

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

Definition at line 18 of file ME.h.

enum ME::EcalRegion
Enumerator
iEEM 
iEBM 
iEBP 
iEEP 
iSizeE 

Definition at line 14 of file ME.h.

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

Definition at line 16 of file ME.h.

enum ME::Gain
Enumerator
iVfeGain12 
iVfeGain6 
iVfeGain1 
iSizeVfeGain 

Definition at line 65 of file ME.h.

enum ME::PN
Enumerator
iPNA 
iPNB 

Definition at line 42 of file ME.h.

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

Definition at line 66 of file ME.h.

enum ME::RunType
Enumerator
iLaser 
iTestPulse 
iSizeT 

Definition at line 63 of file ME.h.

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

Definition at line 150 of file ME.h.

Definition: ME.h:150
Definition: ME.h:150

Constructor & Destructor Documentation

virtual ME::~ME ( )
inlinevirtual

Definition at line 167 of file ME.h.

167 {}

Member Function Documentation

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

Definition at line 545 of file ME.cc.

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

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

545  {
546  if (isBarrel(ilmr))
547  return MEEBGeom::apdRefChannels(ilmmod);
548  else
549  return MEEEGeom::apdRefChannels(ilmmod);
550  return std::vector<int>();
551 }
static std::vector< int > apdRefChannels(int ilmmod)
Definition: MEEBGeom.cc:526
static bool isBarrel(int ilmr)
Definition: ME.cc:527
static std::vector< int > apdRefChannels(int ilmmod)
Definition: MEEEGeom.cc:1364
std::pair< int, int > ME::dccAndSide ( int  ilmr)
static

Definition at line 295 of file ME.cc.

References cms::cuda::assert().

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

295  {
296  int idcc = 0;
297  int side = 0;
298 
299  int ireg = ecalRegion(ilmr);
300  if (ireg == iEEM)
301  ilmr -= 82;
302  else if (ireg == iEBP)
303  ilmr -= 36;
304  else if (ireg == iEEP)
305  ilmr -= 72;
306 
307  if (ireg == iEEM || ireg == iEEP) {
308  assert(ilmr >= 1 && ilmr <= 10);
309  side = 0;
310  idcc = ilmr;
311  if (ilmr >= 9)
312  idcc--;
313  if (ilmr == 9)
314  side = 1;
315  } else {
316  assert(ilmr >= 1 && ilmr <= 36);
317  idcc = (ilmr - 1) / 2 + 1;
318  side = (ilmr - 1) % 2;
319  }
320 
321  if (ireg > iEEM)
322  idcc += 9;
323  if (ireg > iEBM)
324  idcc += 18;
325  if (ireg > iEBP)
326  idcc += 18;
327 
328  // idcc += 600;
329 
330  return std::pair<int, int>(idcc, side);
331 }
Definition: ME.h:14
Definition: ME.h:14
assert(be >=bs)
Definition: ME.h:14
static int ecalRegion(int ilmr)
Definition: ME.cc:230
Definition: ME.h:14
int ME::ecalRegion ( int  ilmr)
static

Definition at line 230 of file ME.cc.

References cms::cuda::assert().

230  {
231  assert(ilmr > 0 && ilmr <= 92);
232  if (ilmr <= 36)
233  return iEBM;
234  ilmr -= 36;
235  if (ilmr <= 36)
236  return iEBP;
237  ilmr -= 36;
238  if (ilmr <= 10)
239  return iEEP;
240  return iEEM;
241 }
Definition: ME.h:14
Definition: ME.h:14
assert(be >=bs)
Definition: ME.h:14
Definition: ME.h:14
bool ME::isBarrel ( int  ilmr)
static

Definition at line 527 of file ME.cc.

527  {
528  int reg_ = ecalRegion(ilmr);
529  if (reg_ == iEEM || reg_ == iEEP)
530  return false;
531  else if (reg_ == iEBM || reg_ == iEBP)
532  return true;
533  else
534  abort();
535  return true;
536 }
Definition: ME.h:14
Definition: ME.h:14
Definition: ME.h:14
static int ecalRegion(int ilmr)
Definition: ME.cc:230
Definition: ME.h:14
TString ME::lmdataPath ( int  lmr)
static

Definition at line 65 of file ME.cc.

References smName().

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

Definition at line 574 of file ME.cc.

References cuy::ii, and PixelPluginsPhase0_cfi::isBarrel.

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

574  {
575  std::vector<int> vec;
576  for (int iside = 0; iside <= 1; iside++) {
577  int ilmr = lmr(idcc, iside);
578  if (ilmr < 0)
579  continue;
580  bool isBarrel_ = isBarrel(ilmr);
581  std::vector<int> vec_ = lmmodFromLmr(ilmr);
582  for (unsigned ii = 0; ii < vec_.size(); ii++) {
583  int ilmmod_ = vec_[ii];
584  if (!isBarrel_) {
585  // special case for Julie
586  if (ilmmod_ == 18 && iside == 1)
587  ilmmod_ = 20;
588  if (ilmmod_ == 19 && iside == 1)
589  ilmmod_ = 21;
590  }
591  vec.push_back(ilmmod_);
592  }
593  }
594  return vec;
595 }
int ii
Definition: cuy.py:589
static bool isBarrel(int ilmr)
Definition: ME.cc:527
static std::vector< ME::LMMid > lmmodFromLmr(ME::LMRid ilmr)
Definition: ME.cc:553
static int lmr(int idcc, int iside)
Definition: ME.cc:243
std::vector< int > ME::lmmodFromLmr ( ME::LMRid  ilmr)
static

Definition at line 553 of file ME.cc.

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

553  {
554  if (isBarrel(ilmr))
555  return MEEBGeom::lmmodFromLmr(ilmr);
556  else
557  return MEEEGeom::lmmodFromLmr(ilmr);
558  return std::vector<int>();
559 }
static bool isBarrel(int ilmr)
Definition: ME.cc:527
static std::vector< int > lmmodFromLmr(int ilmr)
Definition: MEEEGeom.cc:1163
static std::vector< int > lmmodFromLmr(int ilmr)
Definition: MEEBGeom.cc:479
int ME::lmr ( int  idcc,
int  iside 
)
static

Definition at line 243 of file ME.cc.

References cms::cuda::assert().

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

243  {
244  int ilmr = 0;
245 
246  assert(side == 0 || side == 1);
247 
248  if (idcc > 600)
249  idcc -= 600;
250  assert(idcc >= 1 && idcc <= 54);
251  int ireg;
252  if (idcc <= 9)
253  ireg = iEEM;
254  else {
255  idcc -= 9;
256  if (idcc <= 18)
257  ireg = iEBM;
258  else {
259  idcc -= 18;
260  if (idcc <= 18)
261  ireg = iEBP;
262  else {
263  idcc -= 18;
264  if (idcc <= 9)
265  ireg = iEEP;
266  else
267  abort();
268  }
269  }
270  }
271  if (ireg == iEEM || ireg == iEEP) {
272  if (side == 1 && idcc != 8) {
273  return -1;
274  }
275  ilmr = idcc;
276  if (idcc == 9)
277  ilmr++;
278  if (idcc == 8 && side == 1)
279  ilmr++;
280  } else if (ireg == iEBM || ireg == iEBP) {
281  ilmr = 2 * (idcc - 1) + side + 1;
282  } else
283  abort();
284 
285  if (ireg == iEBP)
286  ilmr += 36;
287  else if (ireg == iEEP)
288  ilmr += 72;
289  else if (ireg == iEEM)
290  ilmr += 82;
291 
292  return ilmr;
293 }
Definition: ME.h:14
Definition: ME.h:14
assert(be >=bs)
Definition: ME.h:14
Definition: ME.h:14
MEChannel * ME::lmrTree ( int  ilmr)
static

Definition at line 407 of file ME.cc.

References MEChannel::getDescendant().

407 { return regTree(ecalRegion(ilmr))->getDescendant(iLMRegion, ilmr); }
MEChannel * getDescendant(int ig, int ii)
Definition: MEChannel.cc:103
static int ecalRegion(int ilmr)
Definition: ME.cc:230
static MEChannel * regTree(int ireg)
Definition: ME.cc:409
std::vector< int > ME::memFromDcc ( ME::DCCid  idcc)
static

Definition at line 561 of file ME.cc.

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

561  {
562  std::vector<int> vec;
563  for (int iside = 0; iside <= 1; iside++) {
564  int ilmr = lmr(idcc, iside);
565  if (ilmr < 0)
566  continue;
567  std::pair<int, int> mem_ = memFromLmr(ilmr);
568  vec.push_back(mem_.first);
569  vec.push_back(mem_.second);
570  }
571  return vec;
572 }
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
Definition: ME.cc:538
static int lmr(int idcc, int iside)
Definition: ME.cc:243
std::pair< int, int > ME::memFromLmr ( ME::LMRid  ilmr)
static

Definition at line 538 of file ME.cc.

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

Referenced by TMem::Mem().

538  {
539  if (isBarrel(ilmr))
540  return MEEBGeom::memFromLmr(ilmr);
541  else
542  return MEEEGeom::memFromLmr(ilmr);
543  return std::pair<int, int>();
544 }
static std::pair< int, int > memFromLmr(int ilmr)
Definition: MEEEGeom.cc:1128
static bool isBarrel(int ilmr)
Definition: ME.cc:527
static std::pair< int, int > memFromLmr(int ilmr)
Definition: MEEBGeom.cc:473
TString ME::path ( )
static

Definition at line 81 of file ME.cc.

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

Definition at line 597 of file ME.cc.

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

Referenced by MELaserPrim::fillHistograms().

597  {
598  std::pair<int, int> pnpair_(0, 0);
599  std::pair<int, int> mempair_ = memFromLmr(ilmr);
600  if (isBarrel(ilmr)) {
601  pnpair_ = MEEBGeom::pn(ilmmod);
602  } else {
603  int dee_ = MEEEGeom::dee(ilmr);
604  pnpair_ = MEEEGeom::pn(dee_, ilmmod);
605  }
606  int mem_(0);
607  int pn_(0);
608  if (ipn == iPNA) {
609  mem_ = mempair_.first;
610  pn_ = pnpair_.first;
611  } else {
612  mem_ = mempair_.second;
613  pn_ = pnpair_.second;
614  }
615  return std::pair<int, int>(mem_, pn_);
616 }
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
Definition: ME.cc:538
Definition: ME.h:42
static bool isBarrel(int ilmr)
Definition: ME.cc:527
static std::pair< int, int > pn(int ilmmod)
Definition: MEEBGeom.cc:447
static std::pair< int, int > pn(int dee, int ilmod)
Definition: MEEEGeom.cc:574
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:292
TString ME::primPath ( int  lmr)
static

Definition at line 73 of file ME.cc.

References smName().

73  {
74  TString out_(std::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:243
static TString smName(int ilmr)
Definition: ME.cc:391
void ME::regionAndSector ( int  ilmr,
int &  ireg,
int &  isect,
int &  idcc,
int &  iside 
)
static

Definition at line 333 of file ME.cc.

References cms::cuda::assert().

Referenced by MEGeom::getBoundary(), MEGeom::getHist(), MELaserPrim::MELaserPrim(), and smName().

333  {
334  ireg = ecalRegion(ilmr);
335 
336  std::pair<int, int> ipair_ = dccAndSide(ilmr);
337  idcc = ipair_.first;
338  side = ipair_.second;
339 
340  ism = 0;
341  if (ireg == iEEM || ireg == iEEP) {
342  if (idcc > 600)
343  idcc -= 600; // also works with FEDids
344  if (idcc >= 1 && idcc <= 9) {
345  ism = 6 + idcc;
346  if (ism > 9)
347  ism -= 9;
348  ism += 9;
349  } else if (idcc >= 46 && idcc <= 54) {
350  ism = idcc - 46 + 7;
351  if (ism > 9)
352  ism -= 9;
353  } else
354  abort();
355  } else if (ireg == iEBM || ireg == iEBP) {
356  if (idcc > 600)
357  idcc -= 600; // also works with FEDids
358  assert(idcc >= 10 && idcc <= 45);
359  ism = idcc - 9;
360  if (ism > 18)
361  ism -= 18;
362  else
363  ism += 18;
364  } else
365  abort();
366 }
Definition: ME.h:14
Definition: ME.h:14
assert(be >=bs)
static std::pair< int, int > dccAndSide(int ilmr)
Definition: ME.cc:295
Definition: ME.h:14
static int ecalRegion(int ilmr)
Definition: ME.cc:230
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49
Definition: ME.h:14
MEChannel * ME::regTree ( int  ireg)
static

Definition at line 409 of file ME.cc.

References cms::cuda::assert(), 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().

409  {
410  assert(ireg >= iEEM && ireg <= iEEP);
411  if (_trees[ireg] != nullptr)
412  return _trees[ireg];
413 
414  int iEcalRegion_ = ireg;
415  int iSector_ = 0;
416  int iLMRegion_ = 0;
417  int iLMModule_ = 0;
418  int iSuperCrystal_ = 0;
419  int iCrystal_ = 0;
420  MEChannel* leaf_(nullptr);
421  MEChannel* tree_(nullptr);
422 
423  if (iEcalRegion_ == iEBM || iEcalRegion_ == iEBP) {
424  for (int isect = 1; isect <= 18; isect++) {
425  iSector_ = isect;
426  if (iEcalRegion_ == iEBM)
427  iSector_ += 18;
428  if (_trees[iEcalRegion_] == nullptr) {
429  // std::cout << "Building the tree of crystals -- "
430  // << ME::region[iEcalRegion_];
431  _trees[iEcalRegion_] = new MEChannel(0, 0, iEcalRegion_, nullptr);
432  }
433  tree_ = _trees[iEcalRegion_];
434  for (int iX = 0; iX < 17; iX++) {
435  for (int iY = 0; iY < 4; iY++) {
436  iSuperCrystal_ = MEEBGeom::tt_channel(iX, iY);
437  iLMModule_ = MEEBGeom::lm_channel(iX, iY);
438  for (int jx = 0; jx < 5; jx++) {
439  for (int jy = 0; jy < 5; jy++) {
440  int ix = 5 * iX + jx;
441  int iy = 5 * iY + jy;
443  iCrystal_ = MEEBGeom::electronic_channel(ix, iy);
444  } else {
445  iCrystal_ = MEEBGeom::crystal_channel(ix, iy);
446  }
447  MEEBGeom::EtaPhiCoord globalCoord = MEEBGeom::globalCoord(iSector_, ix, iy);
448  int ieta = globalCoord.first;
449  int iphi = globalCoord.second;
450  iLMRegion_ = MEEBGeom::lmr(ieta, iphi);
451  leaf_ = tree_;
452  leaf_ = leaf_->getDaughter(ieta, iphi, iSector_);
453  leaf_ = leaf_->getDaughter(ieta, iphi, iLMRegion_);
454  leaf_ = leaf_->getDaughter(ieta, iphi, iLMModule_);
455  leaf_ = leaf_->getDaughter(ieta, iphi, iSuperCrystal_);
456  leaf_ = leaf_->getDaughter(ieta, iphi, iCrystal_);
457  }
458  }
459  }
460  }
461  }
462  } else if (iEcalRegion_ == iEEM || iEcalRegion_ == iEEP) {
463  int iz = 1;
464  if (iEcalRegion_ == iEEM)
465  iz = -1;
466  if (_trees[iEcalRegion_] == nullptr) {
467  // std::cout << "Building the tree of crystals -- "
468  // << ME::region[iEcalRegion_];
469  _trees[iEcalRegion_] = new MEChannel(0, 0, iEcalRegion_, nullptr);
470  }
471  tree_ = _trees[iEcalRegion_];
472 
473  for (int ilmr = 72; ilmr <= 92; ilmr++) // force the order of Monitoring Regions
474  {
475  if (ecalRegion(ilmr) != iEcalRegion_)
476  continue;
477  for (int ilmm = 1; ilmm <= 19; ilmm++) // force the order of Monitoring Modules
478  {
479  for (int iXX = 1; iXX <= 10; iXX++) {
480  for (int iside = 1; iside <= 2; iside++) // symmetrize wrt y-axis
481  {
482  int iX = iXX;
483  if (iside == 2)
484  iX = 20 - iXX + 1;
485  for (int iY = 1; iY <= 20; iY++) {
486  //int iSector_ = MEEEGeom::sector( iX, iY );
487  int iSector_ = MEEEGeom::sm(iX, iY, iz);
488  if (iSector_ < 0)
489  continue;
490  iLMRegion_ = MEEEGeom::lmr(iX, iY, iz);
491  if (iLMRegion_ != ilmr)
492  continue;
493  iLMModule_ = MEEEGeom::lmmod(iX, iY);
494  if (iLMModule_ != ilmm)
495  continue;
496  iSuperCrystal_ = MEEEGeom::sc(iX, iY);
497 
498  for (int jxx = 1; jxx <= 5; jxx++) {
499  int jx = jxx; // symmetrize...
500  if (iside == 2)
501  jx = 5 - jxx + 1;
502 
503  for (int jy = 1; jy <= 5; jy++) {
504  int ix = 5 * (iX - 1) + jx;
505  int iy = 5 * (iY - 1) + jy;
506  iCrystal_ = MEEEGeom::crystal(ix, iy);
507  if (iCrystal_ < 0)
508  continue;
509  leaf_ = tree_;
510  leaf_ = leaf_->getDaughter(ix, iy, iSector_);
511  leaf_ = leaf_->getDaughter(ix, iy, iLMRegion_);
512  leaf_ = leaf_->getDaughter(ix, iy, iLMModule_);
513  leaf_ = leaf_->getDaughter(ix, iy, iSuperCrystal_);
514  leaf_ = leaf_->getDaughter(ix, iy, iCrystal_);
515  }
516  }
517  }
518  }
519  }
520  }
521  }
522  }
523  // std::cout << ".... done" << std::endl;
524  return _trees[iEcalRegion_];
525 }
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:112
static int crystal(CrysCoord ix, CrysCoord iy)
Definition: MEEEGeom.cc:372
static bool useElectronicNumbering
Definition: ME.h:36
static int crystal_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:319
Definition: ME.h:14
std::pair< EBGlobalCoord, EBGlobalCoord > EtaPhiCoord
Definition: MEEBGeom.h:24
Definition: ME.h:14
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
Definition: MEEBGeom.cc:110
assert(be >=bs)
static int lm_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:201
static int electronic_channel(EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:326
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
Definition: MEEBGeom.cc:149
static int sm(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:101
Definition: ME.h:14
static int ecalRegion(int ilmr)
Definition: ME.cc:230
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
Definition: MEEBGeom.cc:313
static std::vector< MEChannel * > _trees
Definition: ME.h:169
Definition: ME.h:14
static int sc(SuperCrysCoord iX, SuperCrysCoord iY)
Definition: MEEEGeom.cc:215
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
Definition: MEEEGeom.cc:254
TString ME::rootFileName ( ME::Header  header,
ME::Settings  settings 
)
static

Definition at line 83 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.

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

Definition at line 119 of file ME.cc.

References iBlue, iGreen, iIRed, and iRed.

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

Definition at line 391 of file ME.cc.

References submitPVResolutionJobs::out, regionAndSector(), side_(), and ecaldqm::smName().

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

391  {
392  TString out;
393  int reg_(0);
394  int sm_(0);
395  int dcc_(0);
396  int side_(0);
397  ME::regionAndSector(ilmr, reg_, sm_, dcc_, side_);
398  out = smName(reg_, sm_);
399  return out;
400 }
static void regionAndSector(int ilmr, int &ireg, int &isect, int &idcc, int &iside)
Definition: ME.cc:333
side_(iConfig.getUntrackedParameter< int >("side", 3))
static TString smName(int ilmr)
Definition: ME.cc:391
TString ME::smName ( int  ireg,
int  ism 
)
static

Definition at line 368 of file ME.cc.

References cms::cuda::assert(), iEBM, iEBP, iEEM, iEEP, ecalpyutils::ism(), and submitPVResolutionJobs::out.

368  {
369  TString out;
370  if (ireg == ME::iEEM || ireg == ME::iEEP) {
371  assert(ism >= 1 && ism <= 18);
372  out = "EE+";
373  if (ireg == ME::iEEM)
374  out = "EE-";
375  if (ism > 9)
376  ism -= 9;
377  out += ism;
378  } else if (ireg == ME::iEBM || ireg == ME::iEBP) {
379  assert(ism >= 1 && ism <= 36);
380  out = "EB+";
381  if (ism > 18) {
382  out = "EB-";
383  ism -= 18;
384  }
385  out += ism;
386  } else
387  abort();
388  return out;
389 }
Definition: ME.h:14
Definition: ME.h:14
assert(be >=bs)
Definition: ME.h:14
int ism(int ieta, int iphi)
Definition: EcalPyUtils.cc:49
Definition: ME.h:14
TString ME::smNameFromDcc ( int  idcc)
static

Definition at line 402 of file ME.cc.

References ecaldqm::smName().

402  {
403  int ilmr = lmr(idcc, 0);
404  return smName(ilmr);
405 }
static int lmr(int idcc, int iside)
Definition: ME.cc:243
static TString smName(int ilmr)
Definition: ME.cc:391
ME::Time ME::time ( float  dt,
Time  t0,
int  tunit = iHour 
)
static

Definition at line 200 of file ME.cc.

References gather_cfg::cout, dt, and jetcorrextractor::sign().

200  {
201  short int sign = 1;
202  if (dt < 0)
203  sign = -1;
204  float t_ = sign * dt;
205  switch (tunit) {
206  case iDay:
207  t_ *= 86400;
208  break;
209  case iHour:
210  t_ *= 3600;
211  break;
212  case iMinute:
213  t_ *= 60;
214  break;
215  };
216  ME::Time it_ = static_cast<ME::Time>(t_);
217  std::cout << "dt/it/t0/ " << dt << "/" << it_ << "/" << t0 << std::endl;
218  if (sign == 1)
219  return t0 + it_;
220  else
221  return t0 - it_;
222 }
float dt
Definition: AMPTWrapper.h:136
double sign(double x)
unsigned long Time
Definition: ME.h:68
Definition: ME.h:150
tuple cout
Definition: gather_cfg.py:144
Definition: ME.h:150
ME::Time ME::time_high ( TimeStamp  t)
static

Definition at line 226 of file ME.cc.

Referenced by MELaserPrim::fillHistograms().

226 { return static_cast<Time>(t >> 32); }
unsigned long Time
Definition: ME.h:68
ME::Time ME::time_low ( TimeStamp  t)
static

Definition at line 224 of file ME.cc.

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

Referenced by MELaserPrim::fillHistograms().

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

Definition at line 146 of file ME.cc.

146  {
147  sign = 1;
148  // Time t1 = time_high( T1 );
149  // Time t2 = time_high( T2 );
150  Time dt_s(0);
151  if (t1 > t2) {
152  dt_s = t1 - t2;
153  } else {
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  std::vector<Time> vec_;
166  vec_.push_back(n_day);
167  vec_.push_back(n_h);
168  vec_.push_back(n_min);
169  vec_.push_back(n_s);
170 
171  return vec_;
172 }
double sign(double x)
unsigned long Time
Definition: ME.h:68
float ME::timeDiff ( Time  t1,
Time  t0,
int  tunit = iHour 
)
static

Definition at line 174 of file ME.cc.

References dt, jetcorrextractor::sign(), and FrontierCondition_GT_autoExpress_cfi::t0.

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

Member Data Documentation

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

Definition at line 169 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 131 of file ME.h.

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

Definition at line 158 of file ME.h.

Referenced by edmStreamStallGrapher.StreamInfoElement::unpack().

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

Definition at line 54 of file ME.h.

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

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

Definition at line 70 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 139 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 135 of file ME.h.

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

Definition at line 51 of file ME.h.

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

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

Definition at line 143 of file ME.h.

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

Definition at line 147 of file ME.h.

TString ME::type = {"Laser", "TestPulse"}
static
bool ME::useElectronicNumbering = false
static

Definition at line 36 of file ME.h.