CMS 3D CMS Logo

AlcaBeamSpotFromDB.cc
Go to the documentation of this file.
1 
12 // C++ standard
13 #include <string>
14 // CMS
17 
19 
22 
29 
31  produces<reco::BeamSpot, edm::Transition::EndLuminosityBlock>("alcaBeamSpot");
32 }
33 
35 
36 //--------------------------------------------------------------------------------------------------
38 
39 //--------------------------------------------------------------------------------------------------
41  // read DB object
43  iSetup.get<BeamSpotObjectsRcd>().get(beamhandle);
44  const BeamSpotObjects *spotDB = beamhandle.product();
45 
46  // translate from BeamSpotObjects to reco::BeamSpot
47  reco::BeamSpot::Point apoint(spotDB->GetX(), spotDB->GetY(), spotDB->GetZ());
48 
50  for (int i = 0; i < 7; ++i) {
51  for (int j = 0; j < 7; ++j) {
52  matrix(i, j) = spotDB->GetCovariance(i, j);
53  }
54  }
55 
56  reco::BeamSpot aSpot;
57  // this assume beam width same in x and y
58  aSpot = reco::BeamSpot(
59  apoint, spotDB->GetSigmaZ(), spotDB->Getdxdz(), spotDB->Getdydz(), spotDB->GetBeamWidthX(), matrix);
60  aSpot.setBeamWidthY(spotDB->GetBeamWidthY());
61  aSpot.setEmittanceX(spotDB->GetEmittanceX());
62  aSpot.setEmittanceY(spotDB->GetEmittanceY());
63  aSpot.setbetaStar(spotDB->GetBetaStar());
64 
65  if (spotDB->GetBeamType() == 2) {
67  } else {
69  }
70 
71  auto result = std::make_unique<reco::BeamSpot>();
72  *result = aSpot;
73  lumiSeg.put(std::move(result), std::string("alcaBeamSpot"));
74 
75  // std::cout << " for runs: " << iEvent.id().run() << " - " <<
76  // iEvent.id().run() << std::endl;
77  std::cout << aSpot << std::endl;
78 }
79 
81 
83 
84 // define this as a plug-in
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
BeamSpotObjects::GetBeamWidthY
double GetBeamWidthY() const
get average transverse beam width
Definition: BeamSpotObjects.h:77
BeamSpotObjects::Getdxdz
double Getdxdz() const
get dxdz slope, crossing angle in XZ
Definition: BeamSpotObjects.h:79
mps_fire.i
i
Definition: mps_fire.py:428
reco::BeamSpot::setBeamWidthY
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
MessageLogger.h
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
reco::BeamSpot::setEmittanceY
void setEmittanceY(double v)
Definition: BeamSpot.h:137
ESHandle.h
align::BeamSpot
Definition: StructureType.h:89
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
BeamSpotObjects::GetSigmaZ
double GetSigmaZ() const
get sigma Z, RMS bunch length
Definition: BeamSpotObjects.h:73
LuminosityBlock.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
BeamSpotObjects::GetBeamType
int GetBeamType() const
get beam type
Definition: BeamSpotObjects.h:101
BeamSpotObjects::GetZ
double GetZ() const
get Z beam position
Definition: BeamSpotObjects.h:71
AlcaBeamSpotFromDB::beginJob
void beginJob() final
Definition: AlcaBeamSpotFromDB.cc:80
AlcaBeamSpotFromDB::endLuminosityBlockProduce
void endLuminosityBlockProduce(edm::LuminosityBlock &lumiSeg, const edm::EventSetup &iSetup) final
Definition: AlcaBeamSpotFromDB.cc:40
MakerMacros.h
BeamSpotObjects.h
BeamSpotObjectsRcd.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BeamSpot.h
Service.h
reco::BeamSpot
Definition: BeamSpot.h:21
reco::BeamSpot::Tracker
Definition: BeamSpot.h:24
edm::ESHandle
Definition: DTSurvey.h:22
BeamSpotObjects::GetCovariance
double GetCovariance(int i, int j) const
get i,j element of the full covariance matrix 7x7
Definition: BeamSpotObjects.h:83
reco::BeamSpot::Fake
Definition: BeamSpot.h:24
reco::BeamSpot::setEmittanceX
void setEmittanceX(double v)
Definition: BeamSpot.h:136
AlcaBeamSpotFromDB::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) final
Definition: AlcaBeamSpotFromDB.cc:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BeamSpotObjects::GetBetaStar
double GetBetaStar() const
get beta star
Definition: BeamSpotObjects.h:107
BeamSpotObjects::GetEmittanceX
double GetEmittanceX() const
get emittance
Definition: BeamSpotObjects.h:103
edm::ParameterSet
Definition: ParameterSet.h:47
BeamSpotObjects::GetY
double GetY() const
get Y beam position
Definition: BeamSpotObjects.h:69
reco::BeamSpot::setbetaStar
void setbetaStar(double v)
Definition: BeamSpot.h:138
AlcaBeamSpotFromDB::endJob
void endJob() final
Definition: AlcaBeamSpotFromDB.cc:82
iEvent
int iEvent
Definition: GenABIO.cc:224
BeamSpotObjectsRcd
Definition: BeamSpotObjectsRcd.h:24
BeamSpotObjects
Definition: BeamSpotObjects.h:20
edm::EventSetup
Definition: EventSetup.h:57
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
get
#define get
edm::LuminosityBlock::put
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: LuminosityBlock.h:116
BeamSpotObjects::GetBeamWidthX
double GetBeamWidthX() const
get average transverse beam width
Definition: BeamSpotObjects.h:75
AlcaBeamSpotFromDB::AlcaBeamSpotFromDB
AlcaBeamSpotFromDB(const edm::ParameterSet &)
Definition: AlcaBeamSpotFromDB.cc:30
eostools.move
def move(src, dest)
Definition: eostools.py:511
BeamSpotObjects::GetEmittanceY
double GetEmittanceY() const
get emittance
Definition: BeamSpotObjects.h:105
AlcaBeamSpotFromDB::~AlcaBeamSpotFromDB
~AlcaBeamSpotFromDB() override
Definition: AlcaBeamSpotFromDB.cc:34
BeamSpotObjects::Getdydz
double Getdydz() const
get dydz slope, crossing angle in YZ
Definition: BeamSpotObjects.h:81
EventSetup.h
AlcaBeamSpotFromDB
Definition: AlcaBeamSpotFromDB.h:23
mps_fire.result
result
Definition: mps_fire.py:311
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
reco::BeamSpot::setType
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:124
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
IOVSyncValue.h
AlcaBeamSpotFromDB.h
BeamSpotObjects::GetX
double GetX() const
get X beam position
Definition: BeamSpotObjects.h:67