20 #include <boost/ref.hpp>
21 #include <boost/bind.hpp>
22 #include <boost/function.hpp>
23 #include <boost/iterator/transform_iterator.hpp>
39 return std::count_if(cont.begin(),cont.end(),
40 boost::bind(std::greater<int>(),
64 result.reserve(which.size());
65 for (
unsigned int i=0;
i<which.size();
i++) {
66 result.push_back(cont[which[
i]].getStatusCode());
70 typedef boost::function<void(EcalDAQTowerStatus const & cont, std::vector<int>
const & which, std::vector<float> &
result)>
CondExtractor;
80 std::vector<int>
const &
which()
const {
return m_which;}
112 std::vector<float> res;
113 extractor(m_what.how())(it,m_what.which(),res);
124 std::stringstream
ss;
144 vValues[0].first =
"bit 0 -> towers excluded from the DAQ";
146 vValues[0].second = .0;
149 for(std::vector<EcalObject>::const_iterator iItems = vItems.begin(); iItems != vItems.end(); ++iItems){
151 vValues[0].second += iItems->getStatusCode();
159 std::stringstream
ss;
170 std::vector<int>
const&,
171 std::vector<float>
const& )
const {
175 TCanvas
canvas(
"CC map",
"CC map",800,800);
176 TPad* padb =
new TPad(
"padb",
"padb", 0., 0.55, 1., 1.);
178 TPad* padem =
new TPad(
"padem",
"padem", 0., 0., 0.45, 0.45);
180 TPad* padep =
new TPad(
"padep",
"padep", 0.55, 0., 1., 0.45);
183 TH2F*
barrel =
new TH2F(
"EB",
"EB Tower Status", 72, 0, 72, 34, -17, 17);
184 TH2F* endc_p =
new TH2F(
"EE+",
"EE+ Tower Status",22, 0, 22, 22, 0, 22);
185 TH2F* endc_m =
new TH2F(
"EE-",
"EE- Tower Status",22, 0, 22, 22, 0, 22);
190 if (
object().
find(rawid) ==
object().
end())
continue;
191 int ieta = rawid.
ieta();
193 int iphi = rawid.
iphi() - 1;
194 barrel->Fill(iphi, ieta,
object()[rawid].getStatusCode());
203 int side = rawid.
zside();
205 endc_m->Fill(ix, iy,
object()[rawid].getStatusCode());
207 endc_p->Fill(ix, iy,
object()[rawid].getStatusCode());
210 TLine*
l =
new TLine(0., 0., 0., 0.);
218 for(
int i = 0;
i <17;
i++) {
219 Double_t
x = 4.+ (
i * 4);
220 l =
new TLine(x, -17., x, 17.);
223 l =
new TLine(0., 0., 72., 0.);
226 int ixSectorsEE[133] = {
227 8,14,14,17,17,18,18,19,19,20,20,21,21,20,20,19,19,18,18,17,
228 17,14,14, 8, 8, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 2, 2, 3, 3, 4,
229 4, 5, 5, 8, 8, 8, 9, 9,10,10,12,12,13,13,12,12,10,10, 9, 9,
230 10,10, 0,11,11, 0,10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5, 0,12,13,
231 13,14,14,15,15,16,16,17,17, 0, 9, 8, 8, 3, 3, 1, 0,13,14,14,
232 19,19,21, 0, 9, 8, 8, 7, 7, 5, 5, 3, 3, 2, 0,13,14,14,15,15,
233 17,17,19,19,20, 0,14,14,13,13,12,12,0};
234 int iySectorsEE[133] = {
235 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 8, 8,14,14,17,17,18,18,19,19,
236 20,20,21,21,20,20,19,19,18,18,17,17,14,14, 8, 8, 5, 5, 4, 4,
237 3, 3, 2, 2, 1, 4, 4, 7, 7, 9, 9,10,10,12,12,13,13,12,12,10,
238 10, 9, 0,13,21, 0,13,13,14,14,15,15,16,16,18,18,19, 0,13,13,
239 14,14,15,15,16,16,18,18,19, 0,11,11,12,12,13,13, 0,11,11,12,
240 12,13,13, 0,10,10, 9, 9, 8, 8, 7, 7, 6, 6, 0,10,10, 9, 9, 8,
241 8, 7, 7, 6, 6, 0, 2, 4, 4, 7, 7, 9, 0} ;
245 for (
int i = 0;
i < 132;
i=
i+1) {
246 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
247 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
248 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
249 ixSectorsEE[i+1], iySectorsEE[i+1]);
256 for (
int i = 0;
i < 132;
i=
i+1) {
257 if ( (ixSectorsEE[
i]!=0 || iySectorsEE[
i]!=0) &&
258 (ixSectorsEE[
i+1]!=0 || iySectorsEE[
i+1]!=0) ) {
259 l->DrawLine(ixSectorsEE[
i], iySectorsEE[i],
260 ixSectorsEE[i+1], iySectorsEE[i+1]);
264 canvas.SaveAs(filename.c_str());
270 namespace condPython {
273 using namespace boost::python;
274 enum_<cond::ecalcond::How>(
"How")
281 class_<What>(
"What",init<>())
282 .def(
"set_how",&What::set_how)
283 .def(
"set_which",&What::set_which)
284 .def(
"how",&What::how, return_value_policy<copy_const_reference>())
285 .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)
std::string plot(std::string const &, std::string const &, std::vector< int > const &, std::vector< float > const &) const
tuple cont
load Luminosity info ##
static const unsigned int STATUS
std::vector< Item > Items
std::vector< std::pair< std::string, float > > type_vValues
Code getStatusCode() const
return decoded status
boost::function< void(Container const &cont, std::vector< int > const &which, std::vector< float > &result)> CondExtractor
static EcalScDetId unhashIndex(int hi)
#define PYTHON_WRAPPER(_class, _name)
unsigned int total_values
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
type_vValues getValues(const std::vector< EcalObject > &vItems) override
int bad(Items const &cont)
T x() const
Cartesian x coordinate.
std::string summary() const
void defineWhat< EcalDAQTowerStatus >()
const Items & barrelItems() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Container::value_type value_type
int iphi() const
get the tower iphi
EcalDAQStatusCode EcalObject
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)
std::string printBarrelsEndcaps(const std::vector< T > &barrelItems, const std::vector< T > &endcapItems)
EcalDAQTowerStatusHelper()
void extractBarrel(Container const &cont, std::vector< int > const &, std::vector< float > &result)
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)