86 if (scalel1trigrate != 1.) {
121 std::string lumimethod;
122 int lumichannel = -1;
154 triggerchain.push_back(
"None");
171 bool uselivetrigger =
false;
176 uselivetrigger =
true;
188 std::list<std::pair<unsigned int, unsigned int> > runList;
199 unsigned int val1, val2;
200 if (
found != std::string::npos) {
202 val2 =
atoi(
full.substr(
found+1, std::string::npos).c_str());
207 if (val1 == 0) val1 = minrunnum;
208 if (val2 == 0) val2 = maxrunnum;
211 runList.push_back( std::pair<unsigned int, unsigned int>(val1, val2) );
222 unsigned int runtype = 0;
228 std::cout << args_info.
tag_given <<
" TAG file(s) is given..." << std::endl;
230 tagfile.push_back(args_info.
tag_arg[
i]);
262 logger <<
Root::kERROR <<
"Please provide BOTH --root=\"myfile.root\" AND --tree=\"mytreename\" OR --d3pd_dir=\"mydirname\" options " <<
Root::GEndl;
319 std::list<std::pair<unsigned int, unsigned int> >
::iterator itr = runList.begin();
322 for (; itr != runList.end(); ++itr) {
324 if ((itr->first == minrunnum) || (itr->second == maxrunnum)) {
337 lbstart.push_back(minlbstart);
347 lbend.push_back(maxlbend);
365 std::vector< xAOD::LumiBlockRangeContainer* > iovcVec;
366 std::vector< std::vector<std::string> > triggerchainVec;
376 if (lbstart.size() != lbend.size()) {
398 iovc->setStore( iovcAux );
407 for(itstart = lbstart.begin(), itend = lbend.begin();
408 itstart != lbstart.end() && itend != lbend.end(); ++itstart,++itend) {
409 lbstart_val = (*itstart);
410 lbend_val = (*itend);
412 if (lbstart_val > lbend_val) {
427 for(itrun =
runnumber.begin(), itstart = lbstart.begin(), itend = lbend.begin();
428 itrun !=
runnumber.end() && itstart != lbstart.end() && itend != lbend.end();
429 ++itrun, ++itstart, ++itend) {
441 iovcVec.push_back(iovc);
442 triggerchainVec.push_back(triggerchain);
444 for (
unsigned int j=0; j<triggerchain.size(); ++j)
445 metadata[Form(
"TriggerName%d",j)] = TString(triggerchain[j]);
457 std::string connection =
"";
458 std::string
type =
"RootCollection";
462 int n = (*it).find(
".root");
463 std::string tagfilename = (*it).substr(0,
n);
468 if(collection == NULL) {
475 grlcollection =
reader.GetMergedGRLCollection();
477 for (
unsigned int j=0; j<grlcollection.size(); ++j) {
480 if ( grlcollection[j].HasTriggerInfo() ) {
481 triggerchainVec.push_back(grlcollection[j].GetTriggerList());
482 if (!triggerchain.empty())
484 <<
"> already contain trigger names. Cmd-line triggers are ignored!" <<
Root::GEndl;
486 triggerchainVec.push_back(triggerchain) ;
487 for (
unsigned int k=0;
k<triggerchain.size(); ++
k)
488 grlcollection[j].AddMetaData( Form(
"TriggerName%d",
k),TString(triggerchain[
k]) );
505 grlcollection =
reader.GetMergedGRLCollection();
507 for (
unsigned int j=0; j<grlcollection.size(); ++j) {
510 if ( grlcollection[j].HasTriggerInfo() ) {
511 triggerchainVec.push_back(grlcollection[j].GetTriggerList());
512 if (!triggerchain.empty())
514 <<
"> already contain trigger names. Cmd-line triggers are ignored!" <<
Root::GEndl;
516 triggerchainVec.push_back(triggerchain) ;
517 for (
unsigned int k=0;
k<triggerchain.size(); ++
k)
518 grlcollection[j].AddMetaData( Form(
"TriggerName%d",
k),TString(triggerchain[
k]) );
546 for(
int j=0; j<
list->GetEntries();++j) {
547 TObjString* objstr =
dynamic_cast<TObjString*
>(
list->At(j));
548 if (objstr==0)
continue;
549 if ( objstr->GetString().BeginsWith(
"<?xml version=\"1.0\"?") &&
550 objstr->GetString().Contains(
"DOCTYPE LumiRangeCollection") )
551 reader.AddXMLString(objstr->GetString());
559 grlcollection =
reader.GetMergedGRLCollection();
561 for (
unsigned int j=0; j<grlcollection.size(); ++j) {
564 if ( grlcollection[j].HasTriggerInfo() ) {
565 triggerchainVec.push_back(grlcollection[j].GetTriggerList());
566 if (!triggerchain.empty())
568 <<
"> already contain trigger names. Cmd-line triggers are ignored!" <<
Root::GEndl;
570 triggerchainVec.push_back(triggerchain) ;
571 for (
unsigned int k=0;
k<triggerchain.size(); ++
k)
572 grlcollection[j].AddMetaData( Form(
"TriggerName%d",
k),TString(triggerchain[
k]) );
590 TDirectoryFile *
dir = NULL;
592 dir =
dynamic_cast<TDirectoryFile*
>(
file->GetDirectory(d3pddirname.c_str()));
597 TObjString* objstr = 0;
598 std::map<TString,int> keymap;
601 for(
int j=0; j<
list->GetEntries();j++) {
602 if ( keymap.find(
list->At(j)->GetName())==keymap.end() ) { keymap[
list->At(j)->GetName()] = 1; }
603 else { keymap[
list->At(j)->GetName()] = keymap[
list->At(j)->GetName()]+1; }
605 objstr =
dynamic_cast<TObjString*
>(
dir->Get( Form(
"%s;%d",
list->At(j)->GetName(),keymap[
list->At(j)->GetName()]) ));
608 if ( objstr->GetString().BeginsWith(
"<?xml version=\"1.0\"?") &&
609 objstr->GetString().Contains(
"DOCTYPE LumiRangeCollection") ){
610 reader.AddXMLString(objstr->GetString());
626 grlcollection =
reader.GetMergedGRLCollection();
627 for (
unsigned int j=0; j<grlcollection.size(); ++j) {
630 if ( grlcollection[j].HasTriggerInfo() ) {
631 triggerchainVec.push_back(grlcollection[j].GetTriggerList());
632 if (!triggerchain.empty())
634 <<
"> already contain trigger names. Cmd-line triggers are ignored!" <<
Root::GEndl;
636 triggerchainVec.push_back(triggerchain) ;
637 for (
unsigned int k=0;
k<triggerchain.size(); ++
k)
638 grlcollection[j].AddMetaData( Form(
"TriggerName%d",
k),TString(triggerchain[
k]) );
650 if (runtype != 0 && runList.size() > 0) {
652 for (;iovIt != iovcVec.end(); ++iovIt) {
655 while (
it != (*iovIt)->end()) {
657 unsigned int runnum = (*it)->startRunNumber() ;
660 std::list<std::pair<unsigned int, unsigned int> >
::iterator runIt = runList.begin();
661 for (; runIt != runList.end(); ++runIt) {
662 if (runnum < runIt->
first)
continue;
663 if (
runnum > runIt->second)
continue;
669 logger <<
Root::kDEBUG <<
"Skipping run " << (*it)->startRunNumber() <<
" LB [" << (*it)->startLumiBlockNumber() <<
"-" << (*it)->stopLumiBlockNumber() <<
"] due to command-line run range" <<
Root::GEndl;
672 it = (*iovIt)->begin();
686 for (
unsigned int j=0; j<iovcVec.size(); ++j) {
688 triggerchain = triggerchainVec[j];
693 TTree
tree(
"LumiMetaData",
"LumiMetaData");
698 lumicalc.
UseMC(
false);
707 lumicalc.IntegrateLumi(iovc, (*
it));
721 if(!grlcollection.empty()){
722 TString
xmlfile =
"ilumicalc_merged_";
723 if (xmloutfile.empty()) {
724 if (grlcollection.size()==1) {
xmlfile += grlcollection[0].GetSuggestedName() +
".xml"; }
725 else {
xmlfile +=
"grls.xml"; }
726 }
else {
xmlfile = xmloutfile; }