11 #include <arpa/inet.h>
12 #include <sys/unistd.h>
13 #include <sys/socket.h>
29 nBins_(65),lastISHA_(1000),lastVFS_(1000),lastCalchan_(1000),
33 LogDebug(
"Commissioning") <<
"[CalibrationScanTask::CalibrationScanTask] Constructing object...";
39 int stop = start + 256;
42 LogDebug(
"Commissioning") <<
"[CalibrationScanTask::CalibrationScanTask] Loading pedestal for " << conn.
detId();
43 if(conn.
detId()==0)
return;
44 for(
int strip = start; strip < stop; ++strip) {
45 value = int(pedestalsHandle->getPed(strip,detPedRange));
46 if(value>895) value -= 1024;
54 LogDebug(
"Commissioning") <<
"[CalibrationScanTask::CalibrationScanTask] Destructing object...";
60 LogDebug(
"Commissioning") <<
"[CalibrationScanTask::book]";
86 std::vector<std::string> existingMEs =
dqm()->
getMEs();
87 if(
find(existingMEs.begin(),existingMEs.end(),
"isha")!=existingMEs.end()) {
92 if(
find(existingMEs.begin(),existingMEs.end(),
"isha")!=existingMEs.end()) {
97 if(
find(existingMEs.begin(),existingMEs.end(),
"calchan")!=existingMEs.end()) {
103 LogDebug(
"Commissioning") <<
"[CalibrationScanTask::book] done";
122 int isub,ical = summary.
calChan();
123 isub = ical<4 ? ical+4 : ical-4;
125 for (
int k=0;
k<16;++
k) {
163 std::stringstream complement;
164 complement <<
"ISHA" << isha <<
"_VFS" << vfs;
171 complement.str() ).
title();
180 complement.str() ).
title();
191 if ( getenv(scratch.c_str()) !=
NULL ) {
192 dir = getenv(scratch.c_str());
196 std::stringstream ss;
197 if ( !dir.empty() ) { ss << dir <<
"/"; }
198 else { ss <<
"/tmp/"; }
208 <<
"[SiStripCommissioningSource::" << __func__ <<
"]"
209 <<
" Saved all histograms to file \""
213 <<
"[SiStripCommissioningSource::" << __func__ <<
"]"
214 <<
" Skipping creation of file \""
215 << ss.str() <<
"\" that already exists" ;
219 <<
"[SiStripCommissioningSource::" << __func__ <<
"]"
220 <<
" NULL value for filename! No root file saved!";
242 uint32_t run_number ) {
246 gethostname( hn,
sizeof(hn) );
248 he = gethostbyname(hn);
255 host_ip =
std::string( inet_ntoa( *(
struct in_addr*)(he->h_addr) ) );
257 host_name =
"unknown.cern.ch";
258 host_ip =
"255.255.255.255";
263 std::stringstream ip;
265 while ( pos != std::string::npos ) {
267 if ( tmp != std::string::npos ) {
270 << host_ip.substr( pos, tmp-pos )
276 << host_ip.substr( pos );
277 pos = std::string::npos;
282 pid_t
pid = getpid();
std::vector< float > vNumOfEntries_
const uint32_t & vfs() const
tuple start
Check for commandline option errors.
Utility class that holds histogram title.
const std::string & title() const
const uint32_t & latency() const
sistrip::RunType runType_
uint16_t apvPairNumber() const
MonitorElement * vfsElement_
std::pair< ContainerIterator, ContainerIterator > Range
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< uint16_t > ped
void directory(std::stringstream &, uint32_t run_number=0)
const uint32_t & isha() const
void updateHistoSet(HistoSet &, const uint32_t &bin, const float &value)
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
virtual ~CalibrationScanTask()
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void checkAndSave(const uint16_t &isha, const uint16_t &vfs)
const uint32_t & calSel() const
MonitorElement * ishaElement_
DQMStore *const dqm() const
virtual void fill(const SiStripEventSummary &, const edm::DetSet< SiStripRawDigi > &)
std::vector< std::string > getMEs(void) const
get list of (non-dir) MEs of current directory
std::vector< std::vector< double > > tmp
MonitorElement * calchanElement_
void histo(MonitorElement *)
static const char root_[]
const uint32_t & calChan() const
const FedChannelConnection & connection() const
MonitorElement * bookInt(const char *name)
Book int.
CalibrationScanTask(DQMStore *, const FedChannelConnection &, const sistrip::RunType &, const char *filename, uint32_t run, const edm::EventSetup &setup)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)
const std::string & pwd(void) const