CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlignmentMonitorSurvey.cc
Go to the documentation of this file.
4 
6 
8  :AlignmentMonitorBase(cfg, "AlignmentMonitorSurvey")
9 {
10  const std::vector<std::string>& levels = cfg.getUntrackedParameter< std::vector<std::string> >("surveyResiduals");
11 
12  for (unsigned int l = 0; l < levels.size(); ++l)
13  {
14  theLevels.push_back(AlignableObjectId::stringToId(levels[l]) );
15  }
16 }
17 
19 {
20  align::ID id;
22 
23  double par[6]; // survey residual
24 
25  TTree* tree = directory("/iterN/")->make<TTree>("survey", "");
26 
27  tree->Branch("id" , &id , "id/i");
28  tree->Branch("level", &level, "level/I");
29  tree->Branch("par" , &par , "par[6]/D");
30 
31  const align::Alignables& all = pStore()->alignables();
32 
33  const unsigned int nAlignable = all.size();
34 
35  for (unsigned int i = 0; i < nAlignable; ++i)
36  {
37  const Alignable* ali = all[i];
38 
39  id = ali->id();
40 
41  for (unsigned int l = 0; l < theLevels.size(); ++l)
42  {
43  level = theLevels[l];
44 
45  SurveyResidual resid(*ali, level, true);
46  AlgebraicVector resParams = resid.sensorResidual();
47 
48  par[0] = resParams[0];
49  par[1] = resParams[1];
50  par[2] = resParams[2];
51  par[3] = resParams[3];
52  par[4] = resParams[4];
53  par[5] = resParams[5];
54 
55  tree->Fill();
56  }
57  }
58 }
59 
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
AlignmentParameterStore * pStore()
std::vector< align::StructureType > theLevels
AlignmentMonitorSurvey(const edm::ParameterSet &)
uint32_t ID
Definition: Definitions.h:26
static align::StructureType stringToId(const char *)
TFileDirectory * directory(std::string dir)
T * make(const Args &...args) const
make new ROOT object
virtual void book()
Book or retrieve histograms; MUST be reimplemented.
CLHEP::HepVector AlgebraicVector
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
AlgebraicVector sensorResidual() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
tuple level
Definition: testEve_cfg.py:34
const align::Alignables & alignables(void) const
get all alignables