20 #include <boost/ref.hpp>
21 #include <boost/bind.hpp>
22 #include <boost/function.hpp>
23 #include <boost/iterator/transform_iterator.hpp>
37 return std::count_if(cont.begin(),cont.end(),
38 boost::bind(std::greater<int>(),
39 boost::bind(&value_type::getStatusCode,_1),0)
62 result.reserve(which.size());
63 for (
unsigned int i=0;
i<which.size();
i++) {
64 result.push_back(cont[which[
i]].getStatusCode());
68 typedef boost::function<void(EcalDAQTowerStatus const & cont, std::vector<int>
const & which, std::vector<float> &
result)>
CondExtractor;
78 std::vector<int>
const &
which()
const {
return m_which;}
110 std::vector<float> res;
111 extractor(m_what.how())(it,m_what.which(),res);
122 std::stringstream ss;
130 std::cout <<
"***************************************"<< std::endl;
131 std::stringstream ss;
133 <<
object().barrelItems().size() <<
","
134 <<
object().endcapItems().size() <<
";";
144 std::vector<int>
const&,
145 std::vector<float>
const& )
const {
149 TCanvas
canvas(
"CC map",
"CC map",800,800);
150 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.55, 1., 1.);
152 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
154 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
157 TH2F*
barrel =
new TH2F(
"EB",
"EB Tower Status", 72, 0, 72, 34, -17, 17);
158 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ Tower Status",22, 0, 22, 22, 0, 22);
159 TH2F* endc_m =
new TH2F(
"EE-",
"EE- Tower Status",22, 0, 22, 22, 0, 22);
164 if (
object().
find(rawid) ==
object().
end())
continue;
165 int ieta = rawid.
ieta();
167 int iphi = rawid.
iphi() - 1;
168 barrel->Fill(iphi, ieta,
object()[rawid].getStatusCode());
177 int side = rawid.
zside();
179 endc_m->Fill(ix, iy,
object()[rawid].getStatusCode());
181 endc_p->Fill(ix, iy,
object()[rawid].getStatusCode());
184 TLine*
l =
new TLine(0., 0., 0., 0.);
192 for(
int i = 0;
i <17;
i++) {
193 Double_t
x = 4.+ (
i * 4);
194 l =
new TLine(x, -17., x, 17.);
197 l =
new TLine(0., 0., 72., 0.);
200 int ixSectorsEE[136] = {
201 8,14,14,17,17,18,18,19,19,20,20,21,21,20,20,19,19,18,18,17,
202 17,14,14, 8, 8, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 2, 2, 3, 3, 4,
203 4, 5, 5, 8, 8, 8, 9, 9,10,10,12,12,13,13,12,12,10,10, 9, 9,
204 10,10, 0,11,11, 0,10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 0,12,13,
205 13,14,14,15,15,16,16,17,17, 0, 9, 8, 8, 3, 3, 1, 0,13,14,14,
206 19,19,21, 0, 9, 8, 8, 7, 7, 5, 5, 3, 3, 2, 0,13,14,14,15,15,
207 17,17,19,19,20, 0,14,14,13,13,12,12,0};
208 int iySectorsEE[136] = {
209 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 8, 8,14,14,17,17,18,18,19,19,
210 20,20,21,21,20,20,19,19,18,18,17,17,14,14, 8, 8, 5, 5, 4, 4,
211 3, 3, 2, 2, 1, 4, 4, 7, 7, 9, 9,10,10,12,12,13,13,12,12,10,
212 10, 9, 0,13,21, 0,13,13,14,14,15,15,16,16,18,18,19, 0,13,13,
213 14,14,15,15,16,16,18,18,19, 0,11,11,12,12,13,13, 0,11,11,12,
214 12,13,13, 0,10,10, 9, 9, 8, 8, 7, 7, 6, 6, 0,10,10, 9, 9, 8,
215 8, 7, 7, 6, 6, 0, 2, 4, 4, 7, 7, 9, 0} ;
219 for (
int i = 0;
i < 136;
i=
i+1) {
220 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
221 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
222 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
223 ixSectorsEE[i+1], iySectorsEE[i+1]);
230 for (
int i = 0;
i < 136;
i=
i+1) {
231 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
232 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
233 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
234 ixSectorsEE[i+1], iySectorsEE[i+1]);
238 canvas.SaveAs(filename.c_str());
244 namespace condPython {
247 using namespace boost::python;
248 enum_<cond::ecalcond::How>(
"How")
255 class_<What>(
"What",init<>())
256 .def(
"set_how",&What::set_how)
257 .def(
"set_which",&What::set_which)
258 .def(
"how",&What::how, return_value_policy<copy_const_reference>())
259 .def(
"which",&What::which, return_value_policy<copy_const_reference>())
void extractSuperModules(Container const &cont, std::vector< int > const &which, std::vector< float > &result)
static EcalTrigTowerDetId detIdFromDenseIndex(uint32_t di)
boost::function< void(Container const &cont, std::vector< int > const &which, std::vector< float > &result)> CondExtractor
std::string plot(std::string const &, std::string const &, std::vector< int > const &, std::vector< float > const &) const
std::vector< Item > Items
static EcalScDetId unhashIndex(int hi)
#define PYTHON_WRAPPER(_class, _name)
Container::value_type value_type
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const Items & endcapItems() const
int ieta() const
get the tower ieta
int bad(Items const &cont)
std::string summary() const
void defineWhat< EcalDAQTowerStatus >()
const Items & barrelItems() const
int iphi() const
get the tower iphi
static bool validHashIndex(int hi)
void extractSingleChannel(Container const &cont, std::vector< int > const &which, std::vector< float > &result)
static std::string dumpXML(const EcalCondHeader &header, const EcalDAQTowerStatus &record)
void extractBarrel(Container const &cont, std::vector< int > const &, std::vector< float > &result)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void extractEndcap(Container const &cont, std::vector< int > const &, std::vector< float > &result)
void extractAll(Container const &cont, std::vector< int > const &, std::vector< float > &result)