CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BeamSpot_PayloadInspector.cc
Go to the documentation of this file.
5 
7 
8 #include <sstream>
9 
10 namespace {
11 
12  class BeamSpotPlot_x {
13  public:
14  BeamSpotPlot_x(){
15  }
16 
17  // return the type-name of the objects we handle, so the PayloadInspector can find corresponding tags
18  std::string objectType() {
19  return "BeamSpotObjects";
20  }
21 
22  // return a title string to be used in the PayloadInspector
23  std::string title() {
24  return "x vs run number";
25  }
26 
27  std::string info() {
28  return title();
29  }
30 
31  std::string data( const boost::python::list& iovs ){
33  // TO DO: add try /catch block
34  cond::utilities::JsonPrinter jprint("Run","x");
35  for( int i=0; i< len( iovs ); i++ ) {
36  cond::Iov_t iov = boost::python::extract<cond::Iov_t>( iovs[i] );
37  boost::shared_ptr<BeamSpotObjects> obj = reader.fetch<BeamSpotObjects>( iov.payloadId );
38  jprint.append(boost::lexical_cast<std::string>( iov.since ),
39  boost::lexical_cast<std::string>( obj->GetX() ),
40  boost::lexical_cast<std::string>( obj->GetXError() ) );
41  }
42  return jprint.print();
43  }
44  };
45 
46  class BeamSpotPlot_y {
47  public:
48  BeamSpotPlot_y(){
49  }
50 
51  // return the type-name of the objects we handle, so the PayloadInspector can find corresponding tags
52  std::string objectType() {
53  return "BeamSpotObjects";
54  }
55 
56  // return a title string to be used in the PayloadInspector
57  std::string title() {
58  return "y vs run number";
59  }
60 
61  std::string info() {
62  return title();
63  }
64 
65  std::string data( const boost::python::list& iovs ){
67  // TO DO: add try /catch block
68  cond::utilities::JsonPrinter jprint("Run","y");
69  for( int i=0; i< len( iovs ); i++ ) {
70  cond::Iov_t iov = boost::python::extract<cond::Iov_t>( iovs[i] );
71  boost::shared_ptr<BeamSpotObjects> obj = reader.fetch<BeamSpotObjects>( iov.payloadId );
72  jprint.append(boost::lexical_cast<std::string>( iov.since ),
73  boost::lexical_cast<std::string>( obj->GetY() ),
74  boost::lexical_cast<std::string>( obj->GetYError() ) );
75  }
76  return jprint.print();
77  }
78  };
79 
80  class BeamSpotPlot_xy {
81  public:
82  BeamSpotPlot_xy(){
83  }
84 
85  // return the type-name of the objects we handle, so the PayloadInspector can find corresponding tags
86  std::string objectType() {
87  return "BeamSpotObjects";
88  }
89 
90  // return a title string to be used in the PayloadInspector
91  std::string title() {
92  return "BeamSpot x vs y";
93  }
94 
95  std::string info() {
96  return title();
97  }
98 
99  std::string data( const boost::python::list& iovs ){
101  // TO DO: add try /catch block
102  cond::utilities::JsonPrinter jprint("x","y");
103  for( int i=0; i< len( iovs ); i++ ) {
104  cond::Iov_t iov = boost::python::extract<cond::Iov_t>( iovs[i] );
105  boost::shared_ptr<BeamSpotObjects> obj = reader.fetch<BeamSpotObjects>( iov.payloadId );
106  jprint.append(boost::lexical_cast<std::string>( obj->GetX() ),
107  boost::lexical_cast<std::string>( obj->GetY() ) );
108  }
109  return jprint.print();
110  }
111  };
112 
113 
114 }
115 
117  PAYLOAD_INSPECTOR_CLASS( BeamSpotPlot_x );
118  PAYLOAD_INSPECTOR_CLASS( BeamSpotPlot_y );
119  PAYLOAD_INSPECTOR_CLASS( BeamSpotPlot_xy );
120 }
int i
Definition: DBlmapReader.cc:9
static const TGPicture * info(bool iBackgroundIsBlack)
Time_t since
Definition: Types.h:54
boost::shared_ptr< T > fetch(const cond::Hash &payloadHash)
Definition: PayloadReader.h:63
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
tuple iov
Definition: o2o.py:307
Hash payloadId
Definition: Types.h:56
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void print(std::stringstream &ss) const
print beam spot parameters
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run