//$Id: BrTPMClusterVertexModule.h,v 1.3 2001/09/06 19:29:50 trine Exp $ //$Log: BrTPMClusterVertexModule.h,v $ //Revision 1.3 2001/09/06 19:29:50 trine //Revised BrTPMClusterModule to work with new TPC code and table names, //and to run with bratmain. //Class version changed to 0 as proper for a module. //Small general code cleanup that should not alter functionality. // //Revision 1.2 2001/06/22 17:51:05 cholm //Changes to to data class renaming. // //Revision 1.1.1.1 2001/06/21 14:55:14 hagel //Initial revision of brat2 // //Revision 1.6 2000/11/22 21:21:21 videbaek //Changes due to better handling of Init(). // //Revision 1.5 2000/11/07 16:40:22 bjornhs //Added BrVertexModule to CVS - superclass for vertex-finding. //Major change in TPC-vertex-modules: //BrTPMTrackVertexModule adds BrVertex-object "TPM1 Track VtxData" to outputnode. //BrTPMClusterVertexModule has been thorougly cleaned up to work better and faster. Adds BrVertex-object "TPM1 Cluster VtxData" to outputnode. //BrVertex is slightly edited to reflect these changes. // //Revision 1.4 2000/09/07 08:52:28 bjornhs //Added Y-uncertainties. Removed some unnecesary CPU-usage. // //Revision 1.3 2000/07/15 14:08:45 oslo //Added prelim. VarianceZ() to BrTPM1ClusterVertexModule // //Revision 1.2 2000/06/27 10:08:23 bjornhs //Added y-determination, plus minor bugfixes // //Revision 1.1 2000/06/10 14:43:40 bjornhs //1) Renamed vertexing-classes. //Old BrVertex is now BrTPMTrackVertexModule //Old BrHCVertex is now BrTPMClusterVertexModule //Old BrVertexData is now BrVertex // //2) Made the syntax more universal. Common usage: // - Generate vertexmodule-object // - In event-loop, use SetDetectorTracks() or SetDetectorHits() // to pass data to the vertexmodule // - vertexmodule->Event(inputnode, outputnode) adds a BrVertex-object // called "VtxData" to outputnode // - use BrVertex->GetVertex_found to determine if vertex was successfully // located // //Revision 1.4 2000/05/12 07:07:26 bjornhs //Event is now Event(BrEventNode* inputnode, BrEventNode* outputnode) //Fixed minor bugs // #ifndef BRAT_BrTPMClusterVertexModule #define BRAT_BrTPMClusterVertexModule /////////////////////////////////////////////////////////////////////// // // // BrTPMClusterVertexModule // // // // BRAHMS Vertexing Class, based on histogramming // // calculate vertex y,z-pos from list of clusters in MTPC1 // // Currently it assumes x=0. // // // // Author : Bjorn H. Samset (bjornhs@fys.uio.no) // // Created : 09/may/00 // // Version : 2.0 // // Changed : // // // /////////////////////////////////////////////////////////////////////// //ROOT Classes #ifndef ROOT_TH1 #include "TH1.h" #endif #ifndef ROOT_TF1 #include "TF1.h" #endif #ifndef ROOT_TProfile #include "TProfile.h" #endif #ifndef ROOT_TCanvas #include "TCanvas.h" #endif //Brat Classes #ifndef BRAT_BrModule #include "BrModule.h" #endif #ifndef BRAT_BrVector3D #include "BrVector3D.h" #endif #ifndef BRAT_BrEventNode #include "BrEventNode.h" #endif #ifndef BRAT_BrDataTable #include "BrDataTable.h" #endif #ifndef BRAT_BrGeometryDbManager #include "BrGeometryDbManager.h" #endif #ifndef BRAT_BrParameterDbManager #include "BrParameterDbManager.h" #endif #ifndef BRAT_BrDetectorParamsTPC #include "BrDetectorParamsTPC.h" #endif #ifndef BRAT_BrVertex #include "BrVertex.h" #endif #ifndef BRAT_BrLine3D #include "BrLine3D.h" #endif #ifndef BRAT_BrTpcHit #include "BrTpcHit.h" #endif class BrDetectorVolume; class BrMagnetVolume; class BrTPMClusterVertexModule : public BrModule { public: BrTPMClusterVertexModule(); BrTPMClusterVertexModule(Char_t *Name,Char_t *Title); virtual ~BrTPMClusterVertexModule(); void DefineHistograms(); void Event(BrEventNode* InputNode, BrEventNode* OutputNode); void Init(); void ListVertexParameters(); Int_t GetVertex_found(){return fVertex_found;} // Gives 1 if vertex was successfully determined, otherwise 0 void SetVertexMaxNoPoints(Int_t value) {fMaxNoHits=value;} // Max no of clusters to use void SetVertexMinNoPoints(Int_t value) {fMinNoHits=value;} // Min no of clusters to demand void SetVertexNoSlices(Int_t value) {fNoSlices=value;} // Number of cake-slices to cut TPM1 in void SetDrawHistogram(Int_t value) {fDraw_Histogram=value;} // Draw determining histogram if value = 1 void SetNHistBins(Int_t value) {fNHistBins=value;} // Number of bins in determining histogram void SetUseHistoZoomY(Int_t value) {fUseHistoZoomY=value;} void SetUseHistoZoomZ(Int_t value) {fUseHistoZoomZ=value;} Int_t GetVertexMaxNoPoints() {return fMaxNoHits;} Int_t GetVertexMinNoPoints() {return fMinNoHits;} Int_t GetVertexNoSlices() {return fNoSlices;} Int_t GetDrawHistogram() {return fDraw_Histogram;} Int_t GetNHistBins() {return fNHistBins;} void SetRemoveBackgroundsOn() {kRemoveBackgrounds=kTRUE;} void SetRemoveBackgroundsOff() {kRemoveBackgrounds=kFALSE;} Float_t GetYZoomInterval() {return fYZoomInterval;} Float_t GetZZoomInterval() {return fZZoomInterval;} void SetYZoomInterval(Float_t value) {fYZoomInterval=value;} void SetZZoomInterval(Float_t value) {fZZoomInterval=value;} void SetZFitRange(Float_t value) {fZpos_RMS=value;} Float_t GetZFitRange() {return fZpos_RMS;} void SetYFitRange(Float_t value) {fYpos_RMS=value;} Float_t GetYFitRange() {return fYpos_RMS;} void SetHistbinsDivisonFactor(Int_t value) {fHistbinsDivisionFactor=value;} private: BrDetectorVolume *fFrontVolume; // Volume Descriptor for Front Tracking Chamber BrDetectorParamsTPC *fParams_p; Int_t fVertex_found; // Set to 1 when vertex is determined Int_t fNoSlices; // Number of "slices" to cut TPM1 in Int_t fMaxNoHits; // Max number of hits to compute Int_t fMinNoHits; // Min number of hits before giving up Int_t fNHistBins; // Number of bins in determining histogram Int_t fDraw_Histogram; // Set to kTRUE to draw determining histogram Int_t fUseHistoZoomZ; // zoom z-histogram? Int_t fUseHistoZoomY; // zoom y-histogram? Bool_t kRemoveBackgrounds; TObjArray* fAllHits; TObjArray* fHitSlice; Float_t fZpos_RMS, fYpos_RMS; Float_t fYZoomInterval, fZZoomInterval; Int_t fHistbinsDivisionFactor; TH1F *hVertex_z; TH1F *hVertex_sigma; TH1F *zpos; TH1F *ypos; TH1F *zpos_orig; TH1F *ypos_orig; void SetDefaultParameters(); void ClustersToHits(BrDataTable* tpm1clusters); void FindVertex(BrDataTable* tpm1clusters, BrVertex* vtxdata); void CombineHits(TObjArray& hits, TH1F* histogram, TH1F* histogram_y); Float_t GetMaxPoint(TH1 *hist); Float_t FindVariance(TH1 *hist, Float_t mean, Float_t sigma); TH1 *RemoveLinearBackground(TH1 *hist); public: ClassDef(BrTPMClusterVertexModule,0) }; #endif