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  * $Id: FakeTBHodoscopeRawInfoProducer.cc,v 1.3 2006/10/26 08:01:06 fabiocos Exp $
5  *
6  */
7 
9 
10 using namespace cms;
11 using namespace std;
12 
13 
15 
16  produces<EcalTBHodoscopeRawInfo>();
17 
18  ecalTBInfoLabel_ = ps.getUntrackedParameter<string>("EcalTBInfoLabel","SimEcalTBG4Object");
19 
20  theTBHodoGeom_ = new EcalTBHodoscopeGeometry();
21 
22 }
23 
24 
26 
27  delete theTBHodoGeom_;
28 
29 }
30 
32 {
33  auto_ptr<EcalTBHodoscopeRawInfo> product(new EcalTBHodoscopeRawInfo());
34 
35  // get the vertex information from the event
36 
37  edm::Handle<PEcalTBInfo> theEcalTBInfo;
38  event.getByLabel(ecalTBInfoLabel_,theEcalTBInfo);
39 
40  double partXhodo = theEcalTBInfo->evXbeam();
41  double partYhodo = theEcalTBInfo->evYbeam();
42 
43  LogDebug("EcalTBHodo") << "TB frame vertex (X,Y) for hodoscope simulation: \n"
44  << "x = " << partXhodo << " y = " << partYhodo;
45 
46  // for each hodoscope plane determine the fibre number corresponding
47  // to the event vertex coordinates in the TB reference frame
48  // plane 0/2 = x plane 1/3 = y
49 
50  int nPlanes = (int)theTBHodoGeom_->getNPlanes();
51  product->setPlanes(nPlanes);
52 
53  for ( int iPlane = 0 ; iPlane < nPlanes ; ++iPlane) {
54 
55  float theCoord = (float)partXhodo;
56  if (iPlane == 1 || iPlane == 3) theCoord = (float)partYhodo;
57 
58  vector<int> firedChannels = theTBHodoGeom_->getFiredFibresInPlane(theCoord, iPlane);
59  unsigned int nChannels = firedChannels.size();
60 
61  EcalTBHodoscopePlaneRawHits planeHit(nChannels);
62  for ( unsigned int i = 0 ; i < nChannels ; ++i ) {
63  planeHit.addHit(firedChannels[i]);
64  }
65 
66  product->setPlane((unsigned int)iPlane, planeHit);
67 
68  }
69 
70  LogDebug("EcalTBHodo") << (*product);
71 
72  event.put(product);
73 
74 }
#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.