51 "FIT_METHOD",
"MTQ_AMPL",
"MTQ_TIME",
"MTQ_RISE",
"MTQ_FWHM",
"MTQ_FW20",
"MTQ_FW80",
"MTQ_SLIDING"};
66 TString out_(std::getenv(
"MELMDAT"));
74 TString out_(std::getenv(
"MESTORE"));
81 TString
ME::path() {
return TString(std::getenv(
"MUSECAL")) +
"/"; }
86 TString outfile_ = primPath(lmr_);
94 outfile_ +=
"_BlueLaser";
97 outfile_ +=
"_GreenLaser";
100 outfile_ +=
"_RedLaser";
103 outfile_ +=
"_IRedLaser";
109 outfile_ +=
"_testPulse";
112 outfile_ +=
header.rundir.c_str();
114 outfile_ +=
header.ts_beg;
120 TString outfile_ = primPath(lmr);
121 if (
type == iLaser) {
122 outfile_ +=
"runlist_";
140 }
else if (
type == iTestPulse) {
141 outfile_ +=
"runlist_Test_Pulse";
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;
165 std::vector<Time> vec_;
166 vec_.push_back(n_day);
168 vec_.push_back(n_min);
186 return dt_f / 86400.;
217 std::cout <<
"dt/it/t0/ " <<
dt <<
"/" << it_ <<
"/" <<
t0 << std::endl;
231 assert(ilmr > 0 && ilmr <= 92);
246 assert(side == 0 || side == 1);
250 assert(idcc >= 1 && idcc <= 54);
271 if (ireg == iEEM || ireg == iEEP) {
272 if (side == 1 && idcc != 8) {
278 if (idcc == 8 && side == 1)
280 }
else if (ireg == iEBM || ireg == iEBP) {
281 ilmr = 2 * (idcc - 1) + side + 1;
287 else if (ireg == iEEP)
289 else if (ireg == iEEM)
299 int ireg = ecalRegion(ilmr);
302 else if (ireg == iEBP)
304 else if (ireg == iEEP)
307 if (ireg == iEEM || ireg == iEEP) {
308 assert(ilmr >= 1 && ilmr <= 10);
316 assert(ilmr >= 1 && ilmr <= 36);
317 idcc = (ilmr - 1) / 2 + 1;
318 side = (ilmr - 1) % 2;
330 return std::pair<int, int>(idcc, side);
334 ireg = ecalRegion(ilmr);
336 std::pair<int, int> ipair_ = dccAndSide(ilmr);
338 side = ipair_.second;
341 if (ireg == iEEM || ireg == iEEP) {
344 if (idcc >= 1 && idcc <= 9) {
349 }
else if (idcc >= 46 && idcc <= 54) {
355 }
else if (ireg == iEBM || ireg == iEBP) {
358 assert(idcc >= 10 && idcc <= 45);
403 int ilmr = lmr(idcc, 0);
410 assert(ireg >= iEEM && ireg <= iEEP);
411 if (_trees[ireg] !=
nullptr)
414 int iEcalRegion_ = ireg;
418 int iSuperCrystal_ = 0;
423 if (iEcalRegion_ == iEBM || iEcalRegion_ == iEBP) {
424 for (
int isect = 1; isect <= 18; isect++) {
426 if (iEcalRegion_ == iEBM)
428 if (_trees[iEcalRegion_] ==
nullptr) {
431 _trees[iEcalRegion_] =
new MEChannel(0, 0, iEcalRegion_,
nullptr);
433 tree_ = _trees[iEcalRegion_];
434 for (
int iX = 0; iX < 17; iX++) {
435 for (
int iY = 0; iY < 4; 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;
442 if (useElectronicNumbering) {
448 int ieta = globalCoord.first;
449 int iphi = globalCoord.second;
462 }
else if (iEcalRegion_ == iEEM || iEcalRegion_ == iEEP) {
464 if (iEcalRegion_ == iEEM)
466 if (_trees[iEcalRegion_] ==
nullptr) {
469 _trees[iEcalRegion_] =
new MEChannel(0, 0, iEcalRegion_,
nullptr);
471 tree_ = _trees[iEcalRegion_];
473 for (
int ilmr = 72; ilmr <= 92; ilmr++)
475 if (ecalRegion(ilmr) != iEcalRegion_)
477 for (
int ilmm = 1; ilmm <= 19; ilmm++)
479 for (
int iXX = 1; iXX <= 10; iXX++) {
480 for (
int iside = 1; iside <= 2; iside++)
485 for (
int iY = 1; iY <= 20; iY++) {
491 if (iLMRegion_ != ilmr)
494 if (iLMModule_ != ilmm)
498 for (
int jxx = 1; jxx <= 5; jxx++) {
503 for (
int jy = 1; jy <= 5; jy++) {
504 int ix = 5 * (iX - 1) + jx;
505 int iy = 5 * (iY - 1) + jy;
513 leaf_ = leaf_->
getDaughter(ix, iy, iSuperCrystal_);
524 return _trees[iEcalRegion_];
528 int reg_ = ecalRegion(ilmr);
529 if (reg_ == iEEM || reg_ == iEEP)
531 else if (reg_ == iEBM || reg_ == iEBP)
543 return std::pair<int, int>();
550 return std::vector<int>();
558 return std::vector<int>();
562 std::vector<int> vec;
563 for (
int iside = 0; iside <= 1; iside++) {
564 int ilmr = lmr(idcc, iside);
567 std::pair<int, int> mem_ = memFromLmr(ilmr);
568 vec.push_back(mem_.first);
569 vec.push_back(mem_.second);
575 std::vector<int> vec;
576 for (
int iside = 0; iside <= 1; iside++) {
577 int ilmr = lmr(idcc, iside);
581 std::vector<int> vec_ = lmmodFromLmr(ilmr);
582 for (
unsigned ii = 0;
ii < vec_.size();
ii++) {
583 int ilmmod_ = vec_[
ii];
586 if (ilmmod_ == 18 && iside == 1)
588 if (ilmmod_ == 19 && iside == 1)
591 vec.push_back(ilmmod_);
598 std::pair<int, int> pnpair_(0, 0);
599 std::pair<int, int> mempair_ = memFromLmr(ilmr);
609 mem_ = mempair_.first;
612 mem_ = mempair_.second;
613 pn_ = pnpair_.second;
615 return std::pair<int, int>(mem_, pn_);
static std::pair< int, int > memFromLmr(int ilmr)
static void regionAndSector(int ilmr, int &ireg, int &isect, int &idcc, int &iside)
static int lmmod(SuperCrysCoord iX, SuperCrysCoord iY)
static std::vector< ME::DCCid > memFromDcc(ME::DCCid idcc)
static std::vector< int > apdRefChannels(int ilmmod)
static int crystal(CrysCoord ix, CrysCoord iy)
static const TString PNPrimVar[iSizePN]
static std::pair< ME::DCCid, ME::DCCid > memFromLmr(ME::LMRid ilmr)
static int crystal_channel(EBLocalCoord ix, EBLocalCoord iy)
static const TString region[iSizeE]
std::pair< EBGlobalCoord, EBGlobalCoord > EtaPhiCoord
const Time_t kLowMask(0xFFFFFFFF)
static TString lmdataPath(int lmr)
static std::pair< ME::DCCid, ME::PNid > pn(ME::LMRid ilmr, ME::LMMid ilmmod, ME::PN ipn)
static int lmr(EBGlobalCoord ieta, EBGlobalCoord iphi)
static bool isBarrel(int ilmr)
static TString runListName(int lmr, int type, int color)
MEChannel * getDaughter(int ix, int iy, int ig)
static const TString TPAPDPrimVar[iSizeTPAPD]
static const TimeStamp kLowMask
static Time time_low(TimeStamp t)
static std::pair< int, int > pn(int ilmmod)
static TString rootFileName(ME::Header header, ME::Settings settings)
static int lm_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
static const TString MTQPrimVar[iSizeMTQ]
static const TString TPPNPrimVar[iSizeTPPN]
static std::pair< int, int > pn(int dee, int ilmod)
MEChannel * getDescendant(int ig, int ii)
static int electronic_channel(EBLocalCoord ix, EBLocalCoord iy)
static const TString granularity[iSizeG]
static EtaPhiCoord globalCoord(int ism, EBLocalCoord ix, EBLocalCoord iy)
static const TString APDPrimVar[iSizeAPD]
static std::pair< int, int > dccAndSide(int ilmr)
static int sm(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
static TString smNameFromDcc(int idcc)
static std::vector< int > lmmodFromLmr(int ilmr)
static Time time(float dt, Time t0, int tunit=iHour)
unsigned long long TimeStamp
static std::pair< int, int > memFromLmr(int ilmr)
static int ecalRegion(int ilmr)
static int tt_channel(EBTTLocalCoord iX, EBTTLocalCoord iY)
std::string smName(unsigned)
static MEChannel * regTree(int ireg)
static const TString color[iSizeC]
static const bool useElectronicNumbering
static const TString type[iSizeT]
static std::vector< ME::LMMid > lmmodFromLmr(ME::LMRid ilmr)
static int lmr(int idcc, int iside)
static std::vector< int > apdRefChannels(int ilmmod)
static TString primPath(int lmr)
static Time time_high(TimeStamp t)
static std::vector< Time > timeDiff(Time t1, Time t2, short int &sign)
static int dee(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
static std::vector< MEChannel * > _trees
static TString smName(int ilmr)
int ism(int ieta, int iphi)
static MEChannel * lmrTree(int ilmr)
static int sc(SuperCrysCoord iX, SuperCrysCoord iY)
static std::vector< int > apdRefChannels(ME::LMMid ilmmod, ME::LMRid ilmr)
static std::vector< ME::LMMid > lmmodFromDcc(ME::DCCid idcc)
static int lmr(SuperCrysCoord iX, SuperCrysCoord iY, int iz)
static std::vector< int > lmmodFromLmr(int ilmr)