9 #include "boost/filesystem/operations.hpp" 21 for (
int i=2;
i<9;
i++) slotsOn[
i]=1;
23 for (
int i=13;
i<19;
i++) slotsOn[
i]=1;
60 << HEID.
htrSlot() <<
")" << std::endl;
85 << HEID.
htrSlot() <<
")" << std::endl;
110 << HEID.
htrSlot() <<
")" << std::endl;
120 std::cout <<
"Writing XML..." << std::endl;
121 std::ofstream* of=
nullptr;
127 std::cerr <<
"XML output file " << name <<
" is bad." << std::endl;
130 (*of) <<
"<?xml version='1.0' encoding='UTF-8'?>" << std::endl;
136 if (cd==
nullptr)
continue;
141 snprintf(cr_name,256,
"_crate_%d.xml",crate);
145 std::cerr <<
"XML output file " << name <<
" is bad." << std::endl;
149 (*of) <<
"<?xml version='1.0' encoding='UTF-8'?>" << std::endl;
154 for (
int tb=0; tb<=1; tb++) {
156 if (hd==
nullptr)
continue;
157 for (
int fiber=1; fiber<=8; fiber++) {
162 snprintf(cr_name,256,
"_crate_%d_slot_%d_tb_%d_fiber_%d.xml",crate,slot,tb,fiber);
166 std::cerr <<
"XML output file " << name <<
" is bad." << std::endl;
170 (*of) <<
"<?xml version='1.0' encoding='UTF-8'?>" << std::endl;
184 (*of) <<
"</CFGBrickSet>" << std::endl;
193 (*of) <<
"</CFGBrickSet>" << std::endl;
201 std::cout <<
"Writing root file..." << std::endl;
203 TFile of(name.c_str(),
"RECREATE");
205 std::cerr <<
"root output file " << name <<
" is bad." << std::endl;
213 if (cd==
nullptr)
continue;
215 for (
int tb=0; tb<=1; tb++) {
217 if (hd==
nullptr)
continue;
221 sprintf(hname,
"Exact fC Cr%d,%d%s-%d",crate,slot,
222 ((tb==1)?(
"t"):(
"b")),
chan);
224 hp->SetDirectory(
nullptr);
225 sprintf(hname,
"Quantized fC Cr%d,%d%s-%d",crate,slot,
226 ((tb==1)?(
"t"):(
"b")),
chan);
228 hp->SetDirectory(
nullptr);
229 sprintf(hname,
"Encoded fC Cr%d,%d%s-%d",crate,slot,
230 ((tb==1)?(
"t"):(
"b")),
chan);
232 ha->SetDirectory(
nullptr);
234 hp->Fill(
i*1.0,(*cp)[
i]);
240 of.cd(
"adc"); ha->Write();
int getCoded(int bc) const
std::vector< HBHEDataFrame >::const_iterator const_iterator
constexpr int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
void setTagName(std::string tn)
static const int NUM_CRATES
constexpr int htrTopBottom() const
get the htr top/bottom (1=top/0=bottom), valid for VME
void Fill(HtrXmlPatternToolParameters *params, HBHEDigiCollection::const_iterator data)
ChannelPattern * getPattern(int chan)
constexpr int htrSlot() const
get the htr slot
constexpr int readoutVMECrateId() const
get the readout VME crate number
static const int NUM_SLOTS
constexpr int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
double getQuantized(int bc) const
HalfHtrData * getHalfHtrData(int slot, int one_two_tb)
CrateData * getCrate(int crate)
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
void setSpigot(int spigot)
char data[epos_bytes_allocation]
constexpr int htrChanId() const
get the HTR channel id (1-24)
void writePattern(HalfHtrData *spigotData, int fiber, std::ostream &os, int level=0)
Readout chain identification for Hcal.