2 #include "RecoLuminosity/TCPReceiver/interface/LumiStructures.hh"
22 mChain_ =
new TChain(
"LumiTree");
37 std::string tempFileName;
47 if( ( dp = opendir( dirName_.c_str() ) ) ==
NULL ){
51 while( (dirp = readdir(dp)) !=
NULL ){
52 tempFileName = dirp->d_name;
53 if(tempFileName.substr(0,8) ==
"CMS_LUMI" ){
54 fileNames.push_back( dirName_ + tempFileName);
59 if( fileNames.size() == 0 ){
63 sort(fileNames.begin(), fileNames.end());
64 return ReplaceFile( fileNames );
69 std::vector< std::string > tempVecOfStrings;
71 tempVecOfStrings.clear();
72 tempVecOfStrings.push_back( dirName_ + fileName);
74 return ReplaceFile( tempVecOfStrings );
81 mChain_ =
new TChain(
"LumiTree");
83 for( std::vector< std::string >::const_iterator VoS = fileNames.begin();
84 VoS != fileNames.end();
86 mChain_->Add((*VoS).c_str());
91 return mChain_->GetEntries();
96 Header_ = &(lumiSection_->hdr);
97 Summary_ = &(lumiSection_->lumiSummary);
98 Detail_ = &(lumiSection_->lumiDetail);
100 mChain_->SetBranchAddress(
"Header.", &Header_, &b_Header);
103 mChain_->SetBranchAddress(
"Summary.", &Summary_, &b_Summary);
104 mChain_->SetBranchAddress(
"Detail.", &Detail_, &b_Detail);
107 for(
unsigned int iHLX = 0; iHLX < 36; ++iHLX){
108 std::stringstream branchName;
110 EtSumPtr_[iHLX] = &(lumiSection_->etSum[iHLX]);
111 branchName.str(std::string());
112 branchName <<
"ETSum" << std::setw(2) << std::setfill(
'0') << iHLX <<
".";
113 mChain_->SetBranchAddress(branchName.str().c_str(), &EtSumPtr_[iHLX], &b_ETSum[iHLX]);
116 OccupancyPtr_[iHLX] = &(lumiSection_->occupancy[iHLX]);
117 branchName.str(std::string());
118 branchName <<
"Occupancy" << std::setw(2) << std::setfill(
'0') << iHLX <<
".";
119 mChain_->SetBranchAddress(branchName.str().c_str(), &OccupancyPtr_[iHLX], &b_Occupancy[iHLX]);
121 LHCPtr_[iHLX] = &(lumiSection_->lhc[iHLX]);
122 branchName.str(std::string());
123 branchName <<
"LHC" << std::setw(2) << std::setfill(
'0') << iHLX <<
".";
124 mChain_->SetBranchAddress(branchName.str().c_str(), &LHCPtr_[iHLX], &b_LHC[iHLX]);
133 return mChain_->GetEntries();
138 int bytes = mChain_->GetEntry(entry);
unsigned int GetEntries()
int SetFileName(const std::string &fileName)
std::pair< std::string, MonitorElement * > entry
int GetLumiSection(HCAL_HLX::LUMI_SECTION §ion)
int ReplaceFile(const std::vector< std::string > &fileNames)