//============================================================================ // SiClusteringModule.hh // --------------------- // AC++ module that performs cluster reconstruction in silicon detectors. // The module optionally applies calibration corrections to the silicon // raw data. // // R. Snider // Johns Hopkins University // 3-June-1997 //============================================================================ #ifndef SiClusteringModule_hh #define SiClusteringModule_hh 1 #include "FrameMods/SiHitResolutionCommand.hh" #include "Framework/APPMenu.hh" #include "Framework/APPModule.hh" #include "Framework/AbsParmBool.hh" #include "Framework/AbsParmEnum.hh" #include "Framework/AbsParmGeneral.hh" #include "Framework/AbsParmString.hh" #include "Framework/AbsParmList.hh" #include "SiliconGeometry/SiDigiCode.hh" #include "TrackingMods/SiDataRepCommand.hh" #include "TrackingObjects/Utils/TempTrackingBFieldDefs.hh" #include "TrackingSI/ClusterFinding/SiExtTSCluStrategy.hh" #include "TrackingSI/ClusterFinding/SiLayerFinder.hh" #include "TrackingSI/ClusterFinding/SiTSCluStrategy.hh" #include "TrackingSI/ClusterFinding/SiVClusterFinder.hh" #include //--------------------------------- class DBCorrector; // pedestals, status, per half-ladder class L00Corrector; // pedestals, status, per half-ladder class SiClusterCorrector; class SiStratClusterFinder; class SiStripCorrectorManager; // runs DBCorrector, etc. on SiStripSet class SiVrbInfoSet; class StorableRun2SiStripSet; //--------------------------------- class SiClusteringModule : public AppModule { public: SiClusteringModule( const char * const theName = "SiClusteringModule", const char * const theDescription= "Perform silicon clustering" ); virtual ~SiClusteringModule( ); virtual AppResult beginJob( AbsEvent* aJob ); virtual AppResult beginRun( AbsEvent* aRun ); virtual AppResult event( AbsEvent* anEvent ); virtual AppResult endJob( AbsEvent* aJob ); virtual AppModule * clone(const char* cloneName); private: //----------------------------------------------- // Talk-to parameters //----------------------------------------------- // Configure input and output // // The alternative to getting input data from banks is to get it // directly from a strip set stored in the event. There are potentially // several strip sets in the event, so the description string must be // specified in this case. // // Write cluster banks actually means appending SiClusterSet and SiHitSet // objects to the event. One may optionally set the description string // used for these output objects. // AbsParmBool _regionalMode; AbsParmBool _newFramework; AbsParmBool _inputDataFromBanks; AbsParmString _inputStripSetDescription; AbsParmString _inputBanksDescription; AbsParmBool _readSIXD; AbsParmBool _readISLD; AbsParmBool _writeClusterBanks; AbsParmString _outputDescription; AbsParmBool _writeStripBanks; AbsParmBool _monitorMode; AbsParmBool _useNNDataUnpacker; AbsParmBool _useNNChipThreshold; AbsParmString _processName; // // If we are getting data from banks, we can correct strips: subtract // pedestals and flag bad (hot, dead, half-dead) channels. // APPMenu _stripCorrectorMenu; AbsParmBool _stripCorrFlagBad; AbsParmBool _stripCorrFlagNonIntLadders; AbsParmBool _stripCorrUseChipOn; AbsParmBool _stripCorrRemoveBad; AbsParmBool _stripCorrSubtractPedestal; AbsParmBool _stripCorrRemoveUnderThreshold; AbsParmGeneral _stripCorrNSigmaCut; AbsParmEnum _stripCorrDcmsMode; AbsParmGeneral _stripCorrDcmsOffset; AbsParmString _stripCorrDefaultDbName; AbsParmBool _stripCorrUseL00PedFit; AbsParmGeneral _stripCorrL00FitOrder; AbsParmGeneral _stripCorrL00FitIter; AbsParmGeneral _stripCorrL00ADCmax; AbsParmGeneral _stripCorrPedRun; AbsParmGeneral _stripCorrPedVersion; AbsParmString _stripCorrPedStatus; AbsParmGeneral _stripCorrDeadRun; AbsParmGeneral _stripCorrDeadVersion; AbsParmString _stripCorrDeadStatus; AbsParmGeneral _stripCorrMaskRun; AbsParmGeneral _stripCorrMaskVersion; AbsParmString _stripCorrMaskStatus; AbsParmString _stripCorrIntLadderDB; AbsParmGeneral _stripCorrIntLadderDBRun; AbsParmBool _stripCorrLiveDangerouslyAndSkipCalibration; AbsParmBool _stripCorrInLevel3; AbsParmBool _stripCorrPedestalCorrectorAllowed; // Can rescale the noise read from the DB by these amounts for special studies AbsParmList _stripCorrPhiNoiseScale; // Factor to multiple charge AbsParmList _stripCorrZNoiseScale; // in each strip in clusters // Choose clustering algorithm // AbsParmEnum _pickClusterFinder; // Correct Cluster centroids for magnitic fields and other MC problems // AbsParmBool _correctClusterCentroids; AbsParmEnum _centroidCorrectionModel; AbsParmBool _oldSimData; // Path Name. Used only if RegionDefModule is // also run in order to restrict reconstruction // to those regions appended in the current // path. // AbsParmGeneral _pathName; // Debugging sub-menu parameters // AbsParmBool _printNClusters; AbsParmBool _generateTestStrips; AbsParmBool _printInputStrips; AbsParmBool _printOutputClusters; AbsParmBool _printOutputClusterBanks; AbsParmGeneral _printDebugInfoLevel; AbsParmBool _debugRegional; APPMenu _debugSubMenu; // Clustering parameters // SiLayerFinder::SiLayerFinderParam _phiStripParams; SiLayerFinder::SiLayerFinderParam _zStripParams; APPMenu _phiStripMenu; APPMenu _zStripMenu; std::vector _thresholdMenus; SiHitResolutionCommand _hitResolutionCommand; SiDataRepCommand _dataRepCommand; AbsParmBool _selectDataRepByBankVersion; //----------------------------------------------- // Clustering variables for the new framework //----------------------------------------------- SiStratClusterFinder * _clusterFinder; SiPhiTSCluStrategy::ClusteringParam * _phiClusParam; SiSasTSCluStrategy::ClusteringParam * _sasClusParam; SiZTSCluStrategy::ClusteringParam * _zClusParam; SiPhiTSCluStrategy::ClusteringParam * _l00ClusParam; SiExtTSCluStrategy::ClusteringParam * _extL00ClusParam; AbsParmBool _extendedL00Alg; APPMenu _newPhiMenu; APPMenu _newSasMenu; APPMenu _newZMenu; APPMenu _newL00Menu; APPMenu _extL00Menu; void _initNew(); void _beginJobNew(); //----------------------------------------------- // Private data members //----------------------------------------------- SiVClusterFinder * _theClusterFinder; SiClusterCorrector * _theClusterCorrector; SiVrbInfoSet * _svxDaqInfo; SiVrbInfoSet * _islDaqInfo; //--- The object that manages pedestal subtraction and other corrections //--- on single strips. It invokes another object of the type //--- SiLadderSegmentCorrector for each half-ladder (ladder-segment) to //--- do the dirty work. The configuration happens in a combination of the //--- talk-to and beginJob(). // SiStripCorrectorManager * _theStripCorrectorManager; DBCorrector * _dbCorr; L00Corrector * _l00Corr; //--- Flags that manage the overall behavior of calibrations. // bool _userForbidsCali; bool _userForcesCali; bool _performCali; bool _realisticMC; std::string _dbNameToPass; //----------------------------------------------- // Private utility functions //----------------------------------------------- void _generateStripData( SiStripSet & stripSet ); AppResult _doRegional( EventRecord * event ); //--- All pedestal subtraction and flagging of bad strips done in this //--- method. It returns bool if the event is "good for clustering", and //--- false otherwise. bool _correctStrips ( SiStripSet & stripSet ); //----------------------------------------------- // Structure used in generation of test // clusters (taken from SVX' data). Needs to // be here for template to compile //----------------------------------------------- struct DataCluster { SiDigiCode detCode; int firstStrip; std::list * charge; bool operator==( const DataCluster& dc ) const { return firstStrip == dc.firstStrip; } bool operator< ( const DataCluster& dc ) const { return firstStrip < dc.firstStrip; } }; }; #endif // SiClusteringModule_hh