CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Alignment/MillePedeAlignmentAlgorithm/macros/PlotMillePedeIOV.h

Go to the documentation of this file.
00001 #ifndef PLOTMILLEPEDEIOV_H
00002 #define PLOTMILLEPEDEIOV_H
00003 // Original Author: Gero Flucke
00004 // last change    : $Date: 2013/03/07 11:30:08 $
00005 // by             : $Author: flucke $
00006 //
00007 // PlotMillePedeIOV is a class to plot the IOV dependence of pede parameters
00008 // in case of run-dependend alignment, e.g. for large pixel structures.
00009 // It makes internal use of PlotMillePede and also interfaces
00010 // various selection settings of that class, see PlotMillePede.h.
00011 // (Missing selection possibilities should be simple to add...)
00012 //
00013 // Management of the created histograms is done using the ('ancient')
00014 // class GFHistManager, see description in PlotMillePede.h.
00015 //
00016 // By calling new PlotMillePedeIOV::Draw..(..) commands, usually previously
00017 // drawn canvases are deleted. But if the option 'add' is given, canvases
00018 // from previous Draw-commands are kept (in fact they are re-drawn).
00019 //
00020 // EXAMPLE I: full scale alignment with time dependent large pixel structures
00021 // 
00022 // PlotMillePedeIOV i("treeFile_merge.root");
00023 // i.SetSubDetId(1);      // Select BPIX.
00024 // i.DrawPedeParam("x");
00025 // i.SetSubDetId(2);      // Select FPIX...
00026 // i.AddAdditionalSel("z", 0,100); // ...but only positive z.
00027 // i.DrawPedeParam("add x z");
00028 // i.ClearAdditionalSel();           // Remove selection on z >= 0... 
00029 // i.AddAdditionalSel("z", -100, 0); // ... and request negative z.
00030 // i.DrawPedeParam("add x z");
00031 //
00032 //
00033 // EXAMPLE II: time dependent alignment of large pixel structures
00034 //             using inversion (i.e. errors available), no hierarchy involved
00035 // 
00036 // PlotMillePedeIOV i("treeFile_merge.root");
00037 // i.SetHieraLevel(0); // no hierarchy => lowest level (default is 1, see ctr.)
00038 // i.SetSubDetId(1);      // Select BPIX.
00039 // i.DrawPedeParam("x");
00040 // i.DrawPedeParam("x val"); // same but without error bars
00041 // i.DrawPedeParam("x err add"); // now draw errors vs IOV
00042 // i.SetSubDetId(2);      // Select FPIX...
00043 // i.DrawPedeParam("x val add");
00044 // i.DrawPedeParam("x err add");
00045 
00046 #include <vector>
00047 
00048 class GFHistManager;
00049 class PlotMillePede;
00050 
00051 class PlotMillePedeIOV 
00052 {
00053  public:
00054   explicit PlotMillePedeIOV(const char *fileName, Int_t maxIov = -1, Int_t hieraLevel = 1); // maxIov <=0: find out from file!; hieraLev: -1 ignore, 0 lowest level, etc.
00055   virtual ~PlotMillePedeIOV();
00056 
00057   void DrawPedeParam(Option_t *option = "", unsigned int nNonRigidParam = 0);// "add", any of "x","y","z","id" to add position or DetId in legend, "err" error (not value), "val" skip error bar even if valid 
00058 
00059   //  void SetTitle(const char *title) {fTitle = title;}
00060   //  const TString& GetTitle() const { return fTitle;}
00061   GFHistManager* GetHistManager() { return fHistManager;}
00062   PlotMillePede* GetPlotMillePede(unsigned int i) { return (i < fIovs.size() ? fIovs[i] : 0);}
00063 
00064 
00065   TString Unique(const char *name) const;
00066   Int_t PrepareAdd(bool addPlots);
00067   template<class T>
00068     void SetLineMarkerStyle(T &object, Int_t num) const;
00069   
00070   void SetSubDetId(Int_t subDet);
00071   void SetSubDetIds(Int_t id1, Int_t id2, Int_t id3 = -1, Int_t id4 = -1, Int_t id5 = -1); // ignores id<n> <= 0
00072   void SetAlignableTypeId(Int_t alignableTypeId);//detunit=1,det=2,...,TIBString=15,etc. from StructureType.h (-1: all)
00073   void SetHieraLevel(Int_t hieraLevel); // select hierarchical level (-1: all)
00074   void SetBowsParameters(bool use = true);//true: bows param. for pede
00075   void AddAdditionalSel(const TString &xyzrPhiNhit, Float_t min, Float_t max); // min <= x,y,z,r,phi,Nhit < max
00076   void ClearAdditionalSel();
00077 
00078  private:
00079   struct ParId {
00080     //parameter identified by id (=DetId), objId (=hieraLevel), parameter
00081   public:
00082     ParId(Int_t id, Int_t objId, Int_t par) :
00083       id_(id), objId_(objId), par_(par) {};
00084     Int_t id_, objId_, par_;
00085 
00086     bool operator< (const ParId& other) const; // needed for use as Key in std::map
00087   };
00088   // end struct ParId
00089 
00090   GFHistManager *fHistManager;
00091   std::vector<PlotMillePede*> fIovs;
00092 
00093 };
00094 
00095 #endif