test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CalibrationHistograms.cc
Go to the documentation of this file.
9 #include <iostream>
10 #include <sstream>
11 #include <iomanip>
12 #include "TH1F.h"
13 
14 using namespace std;
15 using namespace sistrip;
16 
17 // -----------------------------------------------------------------------------
20  DQMStore* bei,
21  const sistrip::RunType& task )
22  : CommissioningHistograms( pset.getParameter<edm::ParameterSet>("CalibrationParameters"),
23  bei,
24  task ),
25  calchan_(0),
26  isha_(-1),
27  vfs_(-1)
28 {
30  << "[CalibrationHistograms::" << __func__ << "]"
31  << " Constructing object...";
33  factory_ = auto_ptr<CalibrationSummaryFactory>( new CalibrationSummaryFactory );
34  MonitorElement* calchanElement = bei->get(temp + "/calchan");
35  if(calchanElement) {
36  calchan_ = calchanElement->getIntValue();
38  << "[CalibrationHistograms::" << __func__ << "]"
39  << "CalChan value is " << calchan_;
40  } else {
42  << "[CalibrationHistograms::" << __func__ << "]"
43  << "CalChan value not found. Using " << calchan_;
44  }
45  MonitorElement* ishaElement = bei->get(temp + "/isha");
46  if(ishaElement) isha_ = ishaElement->getIntValue() ;
47  MonitorElement* vfsElement = bei->get(temp + "/vfs");
48  if(vfsElement) vfs_ = vfsElement->getIntValue() ;
49 }
50 
51 // -----------------------------------------------------------------------------
55  << "[CalibrationHistograms::" << __func__ << "]"
56  << " Deleting object...";
57 }
58 
59 // -----------------------------------------------------------------------------
62 
63  // Clear map holding analysis objects
64  Analyses::iterator ianal;
65  for ( ianal = data().begin(); ianal != data().end(); ianal++ ) {
66  if ( ianal->second ) { delete ianal->second; }
67  }
68  data().clear();
69 
70  // Iterate through map containing vectors of profile histograms
71  HistosMap::const_iterator iter = histos().begin();
72  for ( ; iter != histos().end(); iter++ ) {
73  // Check vector of histos is not empty (should be 1 histo)
74  if ( iter->second.empty() ) {
76  << "[CalibrationHistograms::" << __func__ << "]"
77  << " Zero collation histograms found!";
78  continue;
79  }
80 
81  // Retrieve pointers to 1D histos for this FED channel
82  vector<TH1*> profs;
83  Histos::const_iterator ihis = iter->second.begin();
84  for ( ; ihis != iter->second.end(); ihis++ ) {
85  TH1F* prof = ExtractTObject<TH1F>().extract( (*ihis)->me_ );
86  if ( prof ) { profs.push_back(prof); }
87  }
88  // Perform histo analysis
90  CalibrationAlgorithm algo( this->pset(), anal );
91  algo.analysis( profs );
92  data()[iter->first] = anal;
93 
94  }
95 
96 }
97 
98 // -----------------------------------------------------------------------------
101  Analyses::iterator ianal = data().begin();
102  Analyses::iterator janal = data().end();
103  for ( ; ianal != janal; ++ianal ) {
104  if ( ianal->second ) {
105  std::stringstream ss;
106  ianal->second->print( ss,0 );
107  ianal->second->print( ss,1 );
108  if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str();
109  } else { edm::LogWarning(mlDqmClient_) << ss.str(); }
110  }
111  }
112 }
113 
void analysis(const std::vector< TH1 * > &)
const sistrip::RunType & task() const
const edm::ParameterSet & pset() const
Algorithm for calibration runs.
static const char mlDqmClient_[]
void histoAnalysis(bool debug)
Analysis for calibration runs.
CalibrationHistograms(const edm::ParameterSet &pset, DQMStore *, const sistrip::RunType &task=sistrip::CALIBRATION)
#define LogTrace(id)
int extract(std::vector< int > *output, const std::string &dati)
#define debug
Definition: HDRShower.cc:19
int64_t getIntValue(void) const
std::auto_ptr< Factory > factory_
#define begin
Definition: vmac.h:30
static const char root_[]
static const char collate_[]
const HistosMap & histos() const