CMS 3D CMS Logo

V0Fitter.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    V0Producer
00004 // Class:      V0Fitter
00005 // 
00013 //
00014 // Original Author:  Brian Drell
00015 //         Created:  Fri May 18 22:57:40 CEST 2007
00016 // $Id: V0Fitter.h,v 1.12 2008/04/28 23:32:42 drell Exp $
00017 //
00018 //
00019 
00020 #ifndef RECOVERTEX__V0_FITTER_H
00021 #define RECOVERTEX__V0_FITTER_H
00022 
00023 #include "FWCore/Framework/interface/Event.h"
00024 #include "FWCore/Framework/interface/ESHandle.h"
00025 
00026 #include "DataFormats/Common/interface/Ref.h"
00027 
00028 #include "DataFormats/VertexReco/interface/Vertex.h"
00029 #include "DataFormats/TrackReco/interface/Track.h"
00030 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
00031 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00032 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexFitter.h"
00033 
00034 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00035 #include "MagneticField/VolumeBasedEngine/interface/VolumeBasedMagneticField.h"
00036 
00037 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
00038 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00039 
00040 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00041 
00042 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
00043 #include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
00044 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00045 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00046 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00047 #include "Geometry/TrackerGeometryBuilder/interface/GluedGeomDet.h"
00048 
00049 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00050 
00051 #include <string>
00052 #include <fstream>
00053 
00054 
00055 class V0Fitter {
00056  public:
00057   V0Fitter(const edm::ParameterSet& theParams,
00058            const edm::Event& iEvent, const edm::EventSetup& iSetup);
00059   ~V0Fitter();
00060 
00061   // Get methods for the VertexCollections
00062   //reco::VertexCollection getKshortCollection() const;
00063   //reco::VertexCollection getLambdaCollection() const;
00064   //reco::VertexCollection getLambdaBarCollection() const;
00065 
00066   // Switching to L. Lista's reco::Candidate infrastructure for V0 storage
00067   const reco::VertexCompositeCandidateCollection& getKshorts() const;
00068   const reco::VertexCompositeCandidateCollection& getLambdas() const;
00069   const reco::VertexCompositeCandidateCollection& getLambdaBars() const;
00070 
00071  private:
00072   // STL vector of VertexCompositeCandidate that will be filled with VertexCompositeCandidates by fitAll()
00073   reco::VertexCompositeCandidateCollection theKshorts;
00074   reco::VertexCompositeCandidateCollection theLambdas;
00075   reco::VertexCompositeCandidateCollection theLambdaBars;
00076 
00077   // Vector used to temporarily hold candidates before cuts and selection
00078   reco::VertexCompositeCandidateCollection preCutCands;
00079 
00080   // Tracker geometry for discerning hit positions
00081   const TrackerGeometry* trackerGeom;
00082 
00083   const MagneticField* magField;
00084 
00085   std::string recoAlg;
00086   bool useRefTrax;
00087   bool storeRefTrax;
00088   bool doKshorts;
00089   bool doLambdas;
00090 
00091   bool doPostFitCuts;
00092   bool doTkQualCuts;
00093 
00094   // Cuts
00095   double chi2Cut;
00096   double tkChi2Cut;
00097   int tkNhitsCut;
00098   double rVtxCut;
00099   double vtxSigCut;
00100   double collinCut;
00101   double kShortMassCut;
00102   double lambdaMassCut;
00103 
00104   // Helper method that does the actual fitting using the KalmanVertexFitter
00105   void fitAll(const edm::Event& iEvent, const edm::EventSetup& iSetup);
00106 
00107   // Applies cuts to the VertexCompositeCandidates after they are fitted/created.
00108   void applyPostFitCuts();
00109 
00110   // Stuff for debug file output.
00111   std::ofstream mPiPiMassOut;
00112 
00113   inline void initFileOutput() {
00114     mPiPiMassOut.open("mPiPi.txt", ios::app);
00115   }
00116   inline void cleanupFileOutput() {
00117     mPiPiMassOut.close();
00118   }
00119 };
00120 
00121 #endif

Generated on Tue Jun 9 17:46:12 2009 for CMSSW by  doxygen 1.5.4