CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FakeTBHodoscopeRawInfoProducer.cc
Go to the documentation of this file.
1 /*
2  * \file FakeTBHodoscopeRawInfoProducer.cc
3  *
4  *
5  */
6 
8 
9 using namespace cms;
10 using namespace std;
11 
12 
14 
15  produces<EcalTBHodoscopeRawInfo>();
16 
17  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
18 
19  theTBHodoGeom_ = new EcalTBHodoscopeGeometry();
20 
21 }
22 
23 
25 
26  delete theTBHodoGeom_;
27 
28 }
29 
31 {
32  auto_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
33 
34  // get the vertex information from the event
35 
36  edm::Handle<PEcalTBInfo> theEcalTBInfo;
37  event.getByLabel(ecalTBInfoLabel_,theEcalTBInfo);
38 
39  double partXhodo = theEcalTBInfo->evXbeam();
40  double partYhodo = theEcalTBInfo->evYbeam();
41 
42  LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n"
43  << "x = " << partXhodo << " y = " << partYhodo;
44 
45  // for each hodoscope plane determine the fibre number corresponding
46  // to the event vertex coordinates in the TB reference frame
47  // plane 0/2 = x plane 1/3 = y
48 
49  int nPlanes = (int)theTBHodoGeom_->getNPlanes();
50  product->setPlanes(nPlanes);
51 
52  for ( int iPlane = 0 ; iPlane < nPlanes ; ++iPlane) {
53 
54  float theCoord = (float)partXhodo;
55  if (iPlane == 1 || iPlane == 3) theCoord = (float)partYhodo;
56 
57  vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
58  unsigned int nChannels = firedChannels.size();
59 
60  EcalTBHodoscopePlaneRawHits planeHit(nChannels);
61  for ( unsigned int i = 0 ; i < nChannels ; ++i ) {
62  planeHit.addHit(firedChannels[i]);
63  }
64 
65  product->setPlane((unsigned int)iPlane, planeHit);
66 
67  }
68 
69  LogDebug("EcalTBHodo") << (*product);
70 
71  event.put(product);
72 
73 }
#define LogDebug(id)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void produce(edm::Event &event, const edm::EventSetup &eventSetup)
Produce digis out of raw data.
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 but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
FakeTBHodoscopeRawInfoProducer(const edm::ParameterSet &ps)
Constructor.