LCOV - code coverage report
Current view: top level - MUON/MUONbase - AliMUONRecoParam.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 93 471 19.7 %
Date: 2016-06-14 17:26:59 Functions: 10 22 45.5 %

          Line data    Source code
       1             : /**************************************************************************
       2             : * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
       3             : *                                                                        *
       4             : * Author: The ALICE Off-line Project.                                    *
       5             : * Contributors are mentioned in the code where appropriate.              *
       6             : *                                                                        *
       7             : * Permission to use, copy, modify and distribute this software and its   *
       8             : * documentation strictly for non-commercial purposes is hereby granted   *
       9             : * without fee, provided that the above copyright notice appears in all   *
      10             : * copies and that both the copyright notice and this permission notice   *
      11             : * appear in the supporting documentation. The authors make no claims     *
      12             : * about the suitability of this software for any purpose. It is          *
      13             : * provided "as is" without express or implied warranty.                  *
      14             : **************************************************************************/
      15             : 
      16             : // $Id$
      17             : 
      18             : //-----------------------------------------------------------------------------
      19             : /// \class AliMUONRecoParam
      20             : ///
      21             : /// Class with MUON reconstruction parameters
      22             : ///
      23             : ///  \author Philippe Pillot
      24             : //-----------------------------------------------------------------------------
      25             : 
      26             : 
      27             : 
      28             : #include "AliMUONRecoParam.h"
      29             : #include "AliMUONPadStatusMaker.h"
      30             : 
      31             : #include "AliRecoParam.h"
      32             : #include "AliLog.h"
      33             : 
      34             : #include "AliCDBManager.h"
      35             : #include "AliCDBEntry.h"
      36             : 
      37             : #include <Riostream.h>
      38             : 
      39             : using std::cout;
      40             : using std::endl;
      41          18 : ClassImp(AliMUONRecoParam)
      42             : 
      43             : 
      44             : //_____________________________________________________________________________
      45             : AliMUONRecoParam::AliMUONRecoParam()
      46           6 : : AliDetectorRecoParam(),
      47           6 :   fClusteringMode("MLEM"),
      48           6 :   fTrackingMode("KALMAN"),
      49           6 :   fMinBendingMomentum(0.),
      50           6 :   fMaxBendingMomentum(0.),
      51           6 :   fMaxNonBendingSlope(0.),
      52           6 :   fMaxBendingSlope(0.),
      53           6 :   fNonBendingVertexDispersion(0.),
      54           6 :   fBendingVertexDispersion(0.),
      55           6 :   fMaxNonBendingDistanceToTrack(0.),
      56           6 :   fMaxBendingDistanceToTrack(0.),
      57           6 :   fSigmaCutForTracking(0.),
      58           6 :   fSigmaCutForImprovement(0.),
      59           6 :   fSigmaCutForTrigger(0.),
      60           6 :   fStripCutForTrigger(0.),
      61           6 :   fMaxStripAreaForTrigger(0.),
      62           6 :   fMaxNormChi2MatchTrigger(0.),
      63           6 :   fPercentOfFullClusterInESD(10.),
      64           6 :   fCombinedClusterTrackReco(kFALSE),
      65           6 :   fTrackAllTracks(kFALSE),
      66           6 :   fRecoverTracks(kFALSE),
      67           6 :   fMakeTrackCandidatesFast(kFALSE),
      68           6 :   fMakeMoreTrackCandidates(kFALSE),
      69           6 :   fComplementTracks(kFALSE),
      70           6 :   fImproveTracks(kFALSE),
      71           6 :   fUseSmoother(kFALSE),
      72           6 :   fSaveFullClusterInESD(kTRUE),
      73           6 :   fBypassSt45(0),
      74           6 :   fPadGoodnessMask(0),
      75           6 :   fChargeSigmaCut(4.0),
      76           6 :   fRemoveConnectedTracksInSt12(kFALSE),
      77           6 :   fMaxTriggerTracks(0),
      78           6 :   fMaxTrackCandidates(0),
      79           6 :   fSelectTrackOnSlope(kFALSE),
      80           6 :   fMissingPadFractionLimit(-1),
      81           6 :   fFractionOfBuspatchOutsideOccupancyLimit(0),
      82           6 :   fAverageNoisePadCharge(0.22875),
      83           6 :   fClusterChargeCut(2.0),
      84           6 :   fEventSizeSoftLimit(35.0),
      85           6 :   fEventSizeHardLimit(45.0),
      86           6 :   fTokenLostLimit(0.0),
      87           6 :   fTryRecover(kFALSE),
      88           6 :   fDiscardMonoCathodClusters(kFALSE),
      89           6 :   fMonoCathodClNonBendingRes(0.),
      90           6 :   fMonoCathodClBendingRes(0.)
      91          30 : {  
      92             :   /// Constructor
      93             :   
      94           6 :   SetNameTitle("Dummy","Dummy");
      95         132 :   for (Int_t iCh = 0; iCh < 10; iCh++) {
      96          60 :     fUseChamber[iCh] = kTRUE;
      97          60 :     fDefaultNonBendingReso[iCh] = 0.;
      98          60 :     fDefaultBendingReso[iCh] = 0.;
      99             :   }
     100          72 :   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
     101           6 :   SetDefaultLimits();
     102          12 : }
     103             : 
     104             : //_____________________________________________________________________________
     105             : AliMUONRecoParam::~AliMUONRecoParam() 
     106          24 : {
     107             :   /// Destructor
     108          12 : }
     109             : 
     110             : //_____________________________________________________________________________
     111             : void
     112             : AliMUONRecoParam::BypassSt45(Bool_t st4, Bool_t st5)
     113             : {
     114             :         /// Set the bypass status
     115             :         
     116           0 :         if ( st4 && st5 ) fBypassSt45 = 45;
     117           0 :         else if ( st4 ) fBypassSt45 = 4;
     118           0 :         else if ( st5 ) fBypassSt45 = 5;
     119           0 :         else fBypassSt45 = 0;
     120           0 : }
     121             : 
     122             : //_____________________________________________________________________________
     123             : AliMUONRecoParam *AliMUONRecoParam::GetLowFluxParam() 
     124             : {
     125             :   /// Return default reconstruction parameters for low flux environment
     126             :   
     127           0 :   AliMUONRecoParam *param = new AliMUONRecoParam();
     128           0 :   param->SetLowFluxParam();
     129             :   
     130           0 :   return param;
     131           0 : }
     132             : 
     133             : //_____________________________________________________________________________
     134             : AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam() 
     135             : {
     136             :   /// Return default reconstruction parameters for high flux environment
     137             :   
     138           0 :   AliMUONRecoParam *param = new AliMUONRecoParam();
     139           0 :   param->SetHighFluxParam();
     140             :  
     141           0 :   return param;
     142           0 : }
     143             : 
     144             : //_____________________________________________________________________________
     145             : AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam() 
     146             : {
     147             :   /// Return default reconstruction parameters for high flux environment
     148             :   
     149           0 :   AliMUONRecoParam *param = new AliMUONRecoParam();
     150           0 :   param->SetCosmicParam();
     151             :   
     152           0 :   return param;
     153           0 : }
     154             : 
     155             : //_____________________________________________________________________________
     156             : AliMUONRecoParam *AliMUONRecoParam::GetCalibrationParam() 
     157             : {
     158             :   /// Return default (dummy) reconstruction parameters for calibration environment
     159             :   
     160           0 :   AliMUONRecoParam *param = new AliMUONRecoParam();
     161           0 :   param->SetCalibrationParam();
     162             :   
     163           0 :   return param;
     164           0 : }
     165             : 
     166             : 
     167             : //_____________________________________________________________________________
     168             : void AliMUONRecoParam::SetLowFluxParam() 
     169             : {
     170             :   /// Set reconstruction parameters for low flux environment
     171             :   
     172           0 :   SetNameTitle("Low Flux","Low Flux");
     173           0 :   SetEventSpecie(AliRecoParam::kLowMult);
     174           0 :   fMinBendingMomentum = 0.8;
     175           0 :   fMaxBendingMomentum = 1.e10;
     176           0 :   fMaxNonBendingSlope = 0.3;
     177           0 :   fMaxBendingSlope = 0.4;
     178           0 :   fSelectTrackOnSlope = kFALSE;
     179           0 :   fNonBendingVertexDispersion = 70.;
     180           0 :   fBendingVertexDispersion = 70.;
     181           0 :   fMaxNonBendingDistanceToTrack = 1.;
     182           0 :   fMaxBendingDistanceToTrack = 1.;
     183           0 :   fSigmaCutForTracking = 6.;
     184           0 :   fSigmaCutForImprovement = 5.;
     185           0 :   fSigmaCutForTrigger = 4.;
     186           0 :   fStripCutForTrigger = 1.;
     187           0 :   fMaxStripAreaForTrigger = 3.;
     188           0 :   fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
     189           0 :   fCombinedClusterTrackReco = kFALSE;
     190           0 :   fTrackAllTracks = kTRUE;
     191           0 :   fRecoverTracks = kTRUE;
     192           0 :   fMakeTrackCandidatesFast = kFALSE;
     193           0 :   fMakeMoreTrackCandidates = kFALSE;
     194           0 :   fComplementTracks = kTRUE;
     195           0 :   fImproveTracks = kTRUE;
     196           0 :   fRemoveConnectedTracksInSt12 = kFALSE;
     197           0 :   fUseSmoother = kTRUE;
     198           0 :   for (Int_t iCh = 0; iCh < 10; iCh++) {
     199           0 :     fUseChamber[iCh] = kTRUE;
     200           0 :     fDefaultNonBendingReso[iCh] = 0.144;
     201           0 :     fDefaultBendingReso[iCh] = 0.01;
     202             :   }
     203           0 :   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
     204           0 :   fBypassSt45 = 0;
     205           0 :   fMaxTriggerTracks = 100;
     206           0 :   fMaxTrackCandidates = 10000;  
     207           0 :   fDiscardMonoCathodClusters = kFALSE;
     208           0 :   fMonoCathodClNonBendingRes = 10.;
     209           0 :   fMonoCathodClBendingRes = 10.;
     210           0 : }
     211             : 
     212             : //_____________________________________________________________________________
     213             : void AliMUONRecoParam::SetHighFluxParam() 
     214             : {
     215             :   /// Set reconstruction parameters for high flux environment
     216             :   
     217           0 :   SetNameTitle("High Flux","High Flux");
     218           0 :   SetEventSpecie(AliRecoParam::kHighMult);
     219           0 :   fMinBendingMomentum = 0.8;
     220           0 :   fMaxBendingMomentum = 1.e10;
     221           0 :   fMaxNonBendingSlope = 0.3;
     222           0 :   fMaxBendingSlope = 0.4;
     223           0 :   fSelectTrackOnSlope = kFALSE;
     224           0 :   fNonBendingVertexDispersion = 70.;
     225           0 :   fBendingVertexDispersion = 70.;
     226           0 :   fMaxNonBendingDistanceToTrack = 1.;
     227           0 :   fMaxBendingDistanceToTrack = 1.;
     228           0 :   fSigmaCutForTracking = 6.;
     229           0 :   fSigmaCutForImprovement = 5.;
     230           0 :   fSigmaCutForTrigger = 4.;
     231           0 :   fStripCutForTrigger = 1.;
     232           0 :   fMaxStripAreaForTrigger = 3.;
     233           0 :   fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
     234           0 :   fCombinedClusterTrackReco = kFALSE;
     235           0 :   fTrackAllTracks = kTRUE;
     236           0 :   fRecoverTracks = kTRUE;
     237           0 :   fMakeTrackCandidatesFast = kFALSE;
     238           0 :   fMakeMoreTrackCandidates = kFALSE;
     239           0 :   fComplementTracks = kTRUE;
     240           0 :   fImproveTracks = kTRUE;
     241           0 :   fRemoveConnectedTracksInSt12 = kFALSE;
     242           0 :   fUseSmoother = kTRUE;
     243           0 :   for (Int_t iCh = 0; iCh < 10; iCh++) {
     244           0 :     fUseChamber[iCh] = kTRUE;
     245           0 :     fDefaultNonBendingReso[iCh] = 0.144;
     246           0 :     fDefaultBendingReso[iCh] = 0.01;
     247             :   }
     248           0 :   for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
     249           0 :   fBypassSt45 = 0;
     250           0 :   fMaxTriggerTracks = 100;
     251           0 :   fMaxTrackCandidates = 10000;
     252           0 :   fDiscardMonoCathodClusters = kFALSE;
     253           0 :   fMonoCathodClNonBendingRes = 10.;
     254           0 :   fMonoCathodClBendingRes = 10.;
     255           0 : }
     256             : 
     257             : //_____________________________________________________________________________
     258             : void AliMUONRecoParam::SetCosmicParam() 
     259             : {
     260             :   /// Set reconstruction parameters for high flux environment
     261             :   
     262           0 :   SetNameTitle("Cosmic","Cosmic");
     263           0 :   SetEventSpecie(AliRecoParam::kCosmic);
     264           0 :   fMinBendingMomentum = 0.8;
     265           0 :   fMaxBendingMomentum = 1.e10;
     266           0 :   fMaxNonBendingSlope = 0.3;
     267           0 :   fMaxBendingSlope = 0.4;
     268           0 :   fSelectTrackOnSlope = kTRUE;
     269           0 :   fNonBendingVertexDispersion = 170.;
     270           0 :   fBendingVertexDispersion = 170.;
     271           0 :   fMaxNonBendingDistanceToTrack = 1.;
     272           0 :   fMaxBendingDistanceToTrack = 1.;
     273           0 :   fSigmaCutForTracking = 7.;
     274           0 :   fSigmaCutForImprovement = 6.;
     275           0 :   fSigmaCutForTrigger = 4.;
     276           0 :   fStripCutForTrigger = 1.5;
     277           0 :   fMaxStripAreaForTrigger = 3.;
     278           0 :   fMaxNormChi2MatchTrigger = fSigmaCutForTrigger * fSigmaCutForTrigger;
     279           0 :   fPercentOfFullClusterInESD = 100.;
     280           0 :   fCombinedClusterTrackReco = kFALSE;
     281           0 :   fTrackAllTracks = kTRUE;
     282           0 :   fRecoverTracks = kTRUE;
     283           0 :   fMakeTrackCandidatesFast = kFALSE;
     284           0 :   fMakeMoreTrackCandidates = kFALSE;
     285           0 :   fComplementTracks = kTRUE;
     286           0 :   fImproveTracks = kTRUE;
     287           0 :   fRemoveConnectedTracksInSt12 = kTRUE;
     288           0 :   fUseSmoother = kTRUE;
     289           0 :   fSaveFullClusterInESD = kTRUE;
     290           0 :   for (Int_t iCh = 0; iCh < 10; iCh++) {
     291           0 :     fUseChamber[iCh] = kTRUE;
     292           0 :     fDefaultNonBendingReso[iCh] = 0.4;
     293           0 :     fDefaultBendingReso[iCh] = 0.4;
     294             :   }
     295           0 :   fRequestStation[0] = kTRUE;
     296           0 :   fRequestStation[1] = kTRUE;
     297           0 :   fRequestStation[2] = kTRUE;
     298           0 :   fRequestStation[3] = kTRUE;
     299           0 :   fRequestStation[4] = kTRUE;
     300           0 :   fBypassSt45 = 0;
     301           0 :   fPadGoodnessMask = 0x400BE80; // Ped Mean is Zero | Ped Mean Too Low | Ped Mean Too High | Ped Sigma Too Low | Ped Sigma Too High | Ped is missing | HV is missing | manu occupancy too high
     302           0 :   fMaxTriggerTracks = 100;
     303           0 :   fMaxTrackCandidates = 10000;
     304           0 :   fDiscardMonoCathodClusters = kFALSE;
     305           0 :   fMonoCathodClNonBendingRes = 10.;
     306           0 :   fMonoCathodClBendingRes = 10.;
     307             :   
     308           0 :   SetPedMeanLimits(20, 700);
     309           0 :   SetManuOccupancyLimits(-1.,0.01); // reject manu above occ=1%
     310             : 
     311           0 :   SetBuspatchOccupancyLimits(-1,0.05);  
     312           0 :   SetFractionOfBuspatchOutsideOccupancyLimit(0.10); // 10 %
     313           0 : }
     314             : 
     315             : 
     316             : //_____________________________________________________________________________
     317             : void AliMUONRecoParam::SetCalibrationParam() 
     318             : {
     319             :   /// Set (dummy) reconstruction parameters for calibration environment
     320             :   
     321           0 :   SetNameTitle("Calibration","Calibration");
     322           0 :   SetEventSpecie(AliRecoParam::kCalib);
     323             : 
     324           0 :   fPedMeanLimits[0] = 5000;
     325           0 :   fPedMeanLimits[1] = 0;
     326             : 
     327           0 :   fPadGoodnessMask = 0x8C00; // Pedestal is missing | is too low | too high
     328             : 
     329           0 : }
     330             : 
     331             : //_____________________________________________________________________________
     332             : UInt_t
     333             : AliMUONRecoParam::RequestedStationMask() const
     334             : {
     335             :   /// Get the mask of the requested station, i.e. an integer where 
     336             :   /// bit n is set to one if the station n was requested
     337             :   
     338             :   UInt_t m(0);
     339             :   
     340         234 :   for ( Int_t i = 0; i < 5; ++i ) 
     341             :   {
     342         180 :     if ( RequestStation(i) ) m |= ( 1 << i );
     343             :   }
     344          18 :   return m;
     345             : }
     346             : 
     347             : //_____________________________________________________________________________
     348             : void AliMUONRecoParam::Print(Option_t *option) const
     349             : {
     350             :   /// print reconstruction parameters
     351             :   /// if option = FULL then print also unused parameters
     352             :   
     353           0 :   cout<<endl<<"\t------MUON Reconstruction parameters ("<<GetName()<<")------"<<endl;
     354             :   
     355           0 :   if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
     356             :   
     357           0 :   cout << "Event Specie=" << GetEventSpecie() << endl;
     358             :   
     359           0 :   cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
     360           0 :   cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
     361             : 
     362           0 :         TString bypass;
     363             :         
     364           0 :         if ( BypassSt45() )
     365             :         {
     366           0 :                 bypass = "stations 4 and 5";
     367             :         }
     368           0 :         else if ( BypassSt4() ) 
     369             :         {
     370           0 :                 bypass = "station 4";
     371             :         }
     372           0 :         else if ( BypassSt5() ) 
     373             :         {
     374           0 :                 bypass = "station 5";
     375             :         }
     376             :         
     377           0 :   if (bypass.Length()) cout << "Will bypass " << bypass.Data() << " (replacing real clusters by generated ones from trigger tracks)" << endl;
     378             :   
     379           0 :   if (fCombinedClusterTrackReco) cout<<"Combined cluster/track reconstruction: ON"<<endl;
     380           0 :   else cout<<"Combined cluster/track reconstruction: OFF"<<endl;
     381             :   
     382           0 :   if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
     383           0 :   else cout<<"Save partial cluster info in ESD"<<endl;
     384             :     
     385           0 :   cout<<"Selection of track candidates:"<<endl;
     386           0 :   if (fSelectTrackOnSlope) cout<<Form("\t- Non-bending slope < %5.2f",fMaxNonBendingSlope)<<endl;
     387           0 :   else cout<<"\t- Impact parameter < 3 * vertex dispersion in the non-bending direction"<<endl;
     388           0 :   cout<<Form("\t- if B!=0: Bending momentum > %5.2f",fMinBendingMomentum)<<endl;
     389           0 :   if (fSelectTrackOnSlope) cout<<Form("\t  if B==0: Bending slope < %5.2f",fMaxBendingSlope)<<endl;
     390           0 :   else cout<<"\t  if B==0: Impact parameter < 3 * vertex dispersion in the bending direction"<<endl;
     391             :   
     392           0 :   cout<<Form("Vertex dispersion (used to estimate initial bending momentum resolution) = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
     393             :   
     394           0 :   cout<<Form("Maximum distance to track = (%5.2f,%5.2f)",fMaxNonBendingDistanceToTrack,fMaxBendingDistanceToTrack)<<endl;
     395             :   
     396           0 :   cout<<Form("Sigma cut for tracking = %5.2f",fSigmaCutForTracking)<<endl;
     397             : 
     398           0 :   cout<<Form("Sigma cut for trigger hit pattern = %5.2f",fSigmaCutForTrigger)<<endl;
     399             : 
     400           0 :   cout<<Form("Cut in strips for trigger chamber efficiency = %5.2f",fStripCutForTrigger)<<endl;
     401             : 
     402           0 :   cout<<Form("Max search area in strips for trigger chamber efficiency = %5.2f",fMaxStripAreaForTrigger)<<endl;
     403             : 
     404           0 :   if (fTrackAllTracks) cout<<"Track all the possible candidates"<<endl;
     405           0 :   else cout<<"Track only the best candidates"<<endl;
     406             :   
     407           0 :   if (strstr(option,"FULL")) {
     408           0 :     cout<<"Make track candidates assuming linear propagation between stations 4 and 5: ";
     409           0 :     if (fMakeTrackCandidatesFast) cout<<"ON"<<endl;
     410           0 :     else cout<<"OFF"<<endl;
     411           0 :   } else if (fMakeTrackCandidatesFast)
     412           0 :     cout<<"Make track candidates assuming linear propagation between stations 4 and 5"<<endl;
     413             :   
     414           0 :   if (strstr(option,"FULL")) {
     415           0 :     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5: ";
     416           0 :     if (fMakeMoreTrackCandidates) cout<<"ON"<<endl;
     417           0 :     else cout<<"OFF"<<endl;
     418           0 :   } else if (fMakeMoreTrackCandidates)
     419           0 :     cout<<"Make track candidates starting from 1 cluster in each of the stations 4 and 5"<<endl;
     420             :   
     421           0 :   if (strstr(option,"FULL")) {
     422           0 :     cout<<"Try to recover tracks getting lost during tracking: ";
     423           0 :     if (fRecoverTracks) cout<<"ON"<<endl;
     424           0 :     else cout<<"OFF"<<endl;
     425           0 :   } else if (fRecoverTracks)
     426           0 :     cout<<"Try to recover tracks getting lost during tracking"<<endl;
     427             :   
     428           0 :   if (strstr(option,"FULL")) {
     429           0 :     cout<<"Try to complete the reconstructed tracks by adding missing clusters: ";
     430           0 :     if (fComplementTracks) cout<<"ON"<<endl;
     431           0 :     else cout<<"OFF"<<endl;
     432           0 :   } else if (fComplementTracks)
     433           0 :     cout<<"Try to complete the reconstructed tracks by adding missing clusters"<<endl;
     434             :   
     435           0 :   if (strstr(option,"FULL")) {
     436           0 :     cout<<"Try to improve the reconstructed tracks by removing bad clusters: ";
     437           0 :     if (fImproveTracks) cout<<Form("ON (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
     438           0 :     else cout<<"OFF"<<endl;
     439           0 :   } else if (fImproveTracks)
     440           0 :     cout<<Form("Try to improve the reconstructed tracks by removing bad clusters (sigma cut = %5.2f)",fSigmaCutForImprovement)<<endl;
     441             :   
     442           0 :   if (fRemoveConnectedTracksInSt12) cout<<"Remove tracks sharing one cluster or more in any station"<<endl;
     443           0 :   else cout<<"Remove tracks sharing one cluster or more in stations 3, 4 and 5"<<endl;
     444             :   
     445           0 :   if (strstr(option,"FULL")) {
     446           0 :     cout<<"Use smoother to compute final track parameters, etc, at each cluster (used for Kalman tracking only): ";
     447           0 :     if (fUseSmoother) cout<<"ON"<<endl;
     448           0 :     else cout<<"OFF"<<endl;
     449           0 :   } else if (fUseSmoother)
     450           0 :     cout<<"Use smoother to compute final track parameters, etc, at each cluster"<<endl;
     451             :   
     452           0 :   cout<<Form("Maximum normalized chi2 of tracking/trigger track matching = %5.2f",fMaxNormChi2MatchTrigger)<<endl;
     453             :   
     454             :   Bool_t discardedCh = kFALSE;
     455             :   Int_t ch = 0;
     456           0 :   do {
     457           0 :     if (!UseChamber(ch)) {
     458           0 :       if (!discardedCh) {
     459           0 :         cout<<"Discarded chambers(1..): "<<ch+1;
     460             :         discardedCh = kTRUE;
     461           0 :       }
     462           0 :       else cout<<" "<<ch+1;
     463             :     }
     464           0 :   } while (++ch < 10);
     465           0 :   if (discardedCh) cout<<endl;
     466             :   
     467             :   Bool_t discardedSt = kFALSE;
     468             :   Int_t st = 0;
     469           0 :   do {
     470           0 :     if (!RequestStation(st)) {
     471           0 :       if (!discardedSt) {
     472           0 :         cout<<"Not requested stations(1..): "<<st+1;
     473             :         discardedSt = kTRUE;
     474           0 :       }
     475           0 :       else cout<<" "<<st+1;
     476             :     }
     477           0 :   } while (++st < 5);
     478           0 :   if (discardedSt) cout<<endl;
     479             :   
     480           0 :   cout << Form("Pad goodness policy mask is 0x%x",PadGoodnessMask()) << endl;
     481           0 :   cout << "Which means we reject pads having the condition = " <<
     482           0 :   AliMUONPadStatusMaker::AsCondition(PadGoodnessMask()).Data() << endl;
     483             :   
     484           0 :   cout << "The pad limits we are using are :" << endl;
     485             :   
     486           0 :   for ( int ichamber = 0; ichamber < 10; ++ichamber ) 
     487             :   {
     488           0 :     cout << Form("HV Ch %d must be >= %5.2f",ichamber,HVLimit(ichamber)) << endl;
     489             :   }
     490             : 
     491           0 :   cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl;
     492           0 :   cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl;
     493             :   
     494           0 :   cout << Form("And we cut on charge >= %7.2f x ( pedestal sigma ) ",ChargeSigmaCut()) << endl;
     495             :   
     496           0 :   cout << "Occupancy limits are :" << endl;
     497             :   
     498           0 :   cout << Form("%e <= Manu occupancy < %7.3f",ManuOccupancyLowLimit(),ManuOccupancyHighLimit()) << endl;
     499           0 :   cout << Form("%e <= Buspatch occupancy < %7.3f",BuspatchOccupancyLowLimit(),BuspatchOccupancyHighLimit()) << endl;
     500           0 :   cout << Form("%e <= DE occupancy < %7.3f",DEOccupancyLowLimit(),DEOccupancyHighLimit()) << endl;
     501             :   
     502           0 :   cout << "'QAChecker' limits" << endl;  
     503           0 :   cout << Form("FractionOfBuspatchOutsideOccupancyLimit = %5.2f %%",FractionOfBuspatchOutsideOccupancyLimit()*100.0) << endl;
     504           0 :   cout << Form("Event size limit = %5.2f KB/event (soft) and %5.2f KB/event (hard)",fEventSizeSoftLimit,fEventSizeHardLimit) << endl;
     505           0 :   if ( fTokenLostLimit > 0 )
     506             :   {
     507           0 :     cout << Form("We tolerate up to %5.2f %% token lost errors per event",fTokenLostLimit) << endl;
     508             :   }
     509             :   else
     510             :   {
     511           0 :     cout << "We dot not tolerate any token lost error !" << endl;
     512             :   }
     513             :   
     514           0 :   cout << "chamber non bending resolution = |";
     515           0 :   for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultNonBendingReso[iCh]);
     516           0 :   cout << endl;
     517           0 :   cout << "chamber bending resolution = |";
     518           0 :   for (Int_t iCh = 0; iCh < 10; iCh++) cout << Form(" %6.3f |",fDefaultBendingReso[iCh]);
     519           0 :   cout << endl;
     520           0 :   cout<<Form("maximum number of trigger tracks above which the tracking is cancelled = %d",fMaxTriggerTracks)<<endl;
     521           0 :   cout<<Form("maximum number of track candidates above which the tracking is abandonned = %d",fMaxTrackCandidates)<<endl;
     522             : 
     523           0 :   cout << Form("The average noise pad charge is assumed to be %7.2f fC",AverageNoisePadCharge()) << endl;
     524           0 :   cout << Form("and clusters below %5.2f times this noise charge (i.e. %7.2f fC) are discarded",
     525           0 :                ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl;
     526           0 :   cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl;
     527             :   
     528           0 :   if (strstr(option,"FULL")) {
     529           0 :     cout<<"Try to improve the reconstructed tracks by changing the resolution of mono-cathod clusters: ";
     530           0 :     if (fDiscardMonoCathodClusters) cout<<Form("ON (res = %6.3f, %6.3f)",fMonoCathodClNonBendingRes,fMonoCathodClBendingRes)<<endl;
     531           0 :     else cout<<"OFF"<<endl;
     532           0 :   } else if (fDiscardMonoCathodClusters)
     533           0 :     cout<<Form("Try to improve the reconstructed tracks by changing the resolution of mono-cathod clusters (res = %6.3f, %6.3f)",
     534           0 :                fMonoCathodClNonBendingRes,fMonoCathodClBendingRes)<<endl;
     535             :   
     536           0 :   if (TryRecover())
     537             :   {
     538           0 :     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
     539           0 :     cout << "!!! WILL TRY TO RECOVER CORRUPTED RAW DATA !!!" << endl;
     540           0 :     cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;    
     541             :   }
     542           0 :   cout<<"\t-----------------------------------------------------"<<endl<<endl;
     543             :   
     544           0 : }
     545             : 
     546             : //_____________________________________________________________________________
     547             : void
     548             : AliMUONRecoParam::SetHVLimit(Int_t chamberId, Double_t value)
     549             : {
     550             :   /// Set the HV limit for a given chamber (or all chambers 
     551             :   /// if chamberId==-1
     552             :   
     553          12 :   if ( chamberId == -1 ) 
     554             :   {
     555         132 :     for ( Int_t i = 0; i < 10; ++i ) 
     556             :     {
     557          60 :       fHVLimit[i] = value;
     558             :     }
     559           6 :   }
     560           0 :   else if ( chamberId >= 0 && chamberId < 10 ) 
     561             :   {
     562           0 :     fHVLimit[chamberId]=value;
     563           0 :   }
     564             :   else
     565             :   {
     566           0 :     AliError(Form("chamberId = %d is not a valid chamberId",chamberId));
     567             :   }
     568           6 : }
     569             : 
     570             : //_____________________________________________________________________________
     571             : Double_t AliMUONRecoParam::HVLimit(Int_t chamberId) const
     572             : {
     573             :   /// Get the HV limit for a given chamber
     574          40 :   if ( chamberId >= 0 && chamberId < 10 )
     575             :   {
     576          20 :     return fHVLimit[chamberId];
     577             :   }
     578           0 :   AliError(Form("chamberId = %d is not a valid chamberId",chamberId));
     579             : 
     580           0 :   return 0.0;
     581          20 : }
     582             : 
     583             : //_____________________________________________________________________________
     584             : void
     585             : AliMUONRecoParam::SetDefaultLimits()
     586             : {
     587             :         /// Set the default limits and pad goodness policy
     588             : 
     589          12 :   fHVSt12Limits[0]=1500; // kept for backward compatibility only
     590           6 :         fHVSt12Limits[1]=2000; // kept for backward compatibility only
     591           6 :         fHVSt345Limits[0]=1500; // kept for backward compatibility only
     592           6 :         fHVSt345Limits[1]=2000; // kept for backward compatibility only
     593             :   
     594           6 :   SetHVLimit(-1,1590); // this one is the real HV limit used now
     595             :   
     596           6 :         fPedMeanLimits[0] = 20;
     597           6 :         fPedMeanLimits[1] = 1024;
     598             :         
     599           6 :         fPedSigmaLimits[0] = 0.6;
     600           6 :         fPedSigmaLimits[1] = 100;
     601             : 
     602           6 :         fPadGoodnessMask = 0x8080; // Ped is missing | HV is missing
     603             : 
     604           6 :   fManuOccupancyLimits[0] = -1.0; 
     605           6 :   fManuOccupancyLimits[1] = 1.0;
     606             : 
     607           6 :   fBuspatchOccupancyLimits[0] = 1E-6; 
     608           6 :   fBuspatchOccupancyLimits[1] = 1.0;
     609             : 
     610           6 :   fDEOccupancyLimits[0] = -1.0; 
     611           6 :   fDEOccupancyLimits[1] = 1.0;
     612             : 
     613           6 :   fMissingPadFractionLimit = -1; // DEPRECATED
     614           6 :   fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 % 
     615             : 
     616           6 :   ChargeSigmaCut(4.0); // pad with charge < 4.0 x sigma will be removed (where sigma is the actual noise of that very pad, i.e. not the average)
     617             :   
     618           6 :   AverageNoisePadCharge(0.22875); // 0.22875 coulombs ~ 1.5 ADC channels
     619             : 
     620           6 :   ClusterChargeCut(2.0); // will cut cluster below 2.0 x LowestPadCharge()
     621             :   
     622           6 :   SetEventSizeLimits(35.0,45.0);
     623             :   
     624           6 :   SetTokenLostLimit(0.0);
     625             :   
     626           6 :   fTryRecover = kFALSE;
     627           6 : }
     628             : 
     629             : 
     630             : //-----------------------------------------------------------------------
     631             : TObjArray* 
     632             : AliMUONRecoParam::Create(const char* settings)
     633             : {
     634             :   /// Create pre-defined recoparam array, according to settings.
     635             :   /// settings is case-insensitive.
     636             :   ///
     637             :   /// Currently defined are :
     638             :   ///
     639             :   /// "cosmics" :
     640             :   ///      Cosmic (default)
     641             :   ///      Calibration
     642             :   /// "ppideal"
     643             :   ///      LowFlux (default)
     644             :   ///      Calibration
     645             :   /// "ppreal"
     646             :   ///      LowFlux (modified to reconstruct real p-p data)
     647             :   ///      Calibration
     648             :   /// "pprealsim"
     649             :   ///      LowFlux (modified to reconstruct realistic p-p simulation)
     650             :   ///      Calibration
     651             :   /// "pbpbreal"
     652             :   ///      HighFlux (modified to reconstruct real Pb-Pb data)
     653             :   ///      Calibration
     654             :   
     655             :   AliMUONRecoParam* param(0x0);
     656             :   
     657             :   AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult;
     658             :   
     659           0 :   TString stype(settings);
     660           0 :   stype.ToLower();
     661             :   
     662           0 :   if ( stype == "cosmics" )
     663             :   {
     664             :     // set parameters for cosmic runs
     665           0 :     param = AliMUONRecoParam::GetCosmicParam();
     666             :     defaultParam = AliRecoParam::kCosmic;
     667           0 :   }
     668           0 :   else if ( stype == "ppideal" ) 
     669             :   {
     670             :     // set default lowFlux parameters
     671           0 :     param = AliMUONRecoParam::GetLowFluxParam();
     672           0 :   }
     673           0 :   else if ( stype == "ppreal" || stype == "pprealsim" || stype == "pprealnofield" ) 
     674             :   {      
     675             :     // common parameters for p-p data and realistic p-p simu
     676           0 :     param = AliMUONRecoParam::GetLowFluxParam();
     677           0 :     param->SaveFullClusterInESD(kTRUE, 100.);
     678           0 :     for (Int_t iCh=0; iCh<10; iCh++) 
     679             :     {
     680           0 :       param->SetDefaultNonBendingReso(iCh,0.4);
     681           0 :       param->SetDefaultBendingReso(iCh,0.4);
     682             :     }
     683           0 :     param->SetSigmaCutForTracking(7.);
     684           0 :     param->SetStripCutForTrigger(1.5);
     685           0 :     param->SetSigmaCutForTrigger(6.);
     686           0 :     param->ImproveTracks(kTRUE, 6.);
     687           0 :     param->SetPedMeanLimits(20, 700);
     688           0 :     param->SetManuOccupancyLimits(-1.,0.015);
     689           0 :     param->SetBuspatchOccupancyLimits(-1.,0.05);  
     690           0 :     param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
     691           0 :     param->SetEventSizeLimits(45., 65.);
     692           0 :     param->SetHVLimit(0,1550);
     693           0 :     param->SetHVLimit(1,1550);
     694           0 :     param->SetHVLimit(2,1550);
     695           0 :     param->SetHVLimit(3,1550);
     696             :     
     697             :     // specific parameters for p-p data or realistic p-p simu
     698           0 :     if ( stype == "ppreal" || stype == "pprealnofield" )
     699             :     {
     700           0 :       param->SetPadGoodnessMask(0x400BE9B);
     701           0 :     }
     702             :     else
     703             :     {
     704           0 :       param->SetPadGoodnessMask(0x8080);      
     705             :     }
     706             :     
     707           0 :     if ( stype == "pprealnofield" )
     708             :     {
     709           0 :       param->TryRecover(kTRUE);
     710             :     }
     711             :   }
     712           0 :   else if ( stype == "pbpbreal" || stype == "pbpbrealsim" ) 
     713             :   {      
     714             :     // common parameters for Pb-Pb data and realistic Pb-Pb simu
     715           0 :     param = AliMUONRecoParam::GetHighFluxParam();
     716             :     defaultParam = AliRecoParam::kHighMult;
     717           0 :     param->SaveFullClusterInESD(kTRUE, 100.);
     718           0 :     for (Int_t iCh=0; iCh<10; iCh++) 
     719             :     {
     720           0 :       param->SetDefaultNonBendingReso(iCh,0.2);
     721           0 :       param->SetDefaultBendingReso(iCh,0.2);
     722             :     }
     723           0 :     param->SetSigmaCutForTracking(5.);
     724           0 :     param->SetStripCutForTrigger(1.5);
     725           0 :     param->SetSigmaCutForTrigger(4.);
     726             : //    param->MakeMoreTrackCandidates(kTRUE);
     727           0 :     param->ImproveTracks(kTRUE, 4.);
     728           0 :     param->SetPedMeanLimits(20, 700);
     729           0 :     param->SetManuOccupancyLimits(-1.,0.03);
     730           0 :     param->SetBuspatchOccupancyLimits(-1.,0.1); // 10 % (this cut not used for the reco anyway)
     731           0 :     param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 %
     732           0 :     param->SetEventSizeLimits(100., 150.);
     733           0 :     param->DiscardMonoCathodClusters(kTRUE, 10., 10.);
     734             :     
     735             :     // specific parameters for Pb-Pb data or realistic Pb-Pb simu
     736           0 :     if ( stype == "pbpbreal" )
     737             :     {
     738           0 :       param->SetPadGoodnessMask(0x400BE9B);
     739           0 :     }
     740             :     else
     741             :     {
     742           0 :       param->SetPadGoodnessMask(0x8080);      
     743             :     }
     744             :   }
     745             :   else
     746             :   {
     747           0 :     AliErrorClass("Unknown settings !");
     748           0 :     return 0x0;
     749             :   }
     750             : 
     751           0 :   TObjArray* recoParams = new TObjArray;
     752             : 
     753           0 :   recoParams->AddLast(param);
     754             :   
     755             :   // set (dummy) parameters for calibration runs
     756           0 :   param = AliMUONRecoParam::GetCalibrationParam();
     757           0 :   recoParams->AddLast(param);
     758             :   
     759             :   // set parameters for Pb-Pb runs
     760             :   // param = AliMUONRecoParam::GetHighFluxParam();
     761             :   // recoParams.AddLast(param);
     762             :   
     763             :   // identify default parameters (exit if identification failed)
     764             :   Bool_t defaultIsSet = kFALSE;
     765           0 :   TIter next(recoParams);
     766           0 :   while ( (param = static_cast<AliMUONRecoParam*>(next())) ) 
     767             :   {
     768           0 :     if (param->GetEventSpecie() == defaultParam) 
     769             :     {
     770           0 :       param->SetAsDefault();
     771             :       defaultIsSet = kTRUE;
     772           0 :     }
     773           0 :     param->Print("FULL");
     774             :   }
     775             :   
     776           0 :   if (!defaultIsSet) 
     777             :   {
     778           0 :     AliErrorClass("The default reconstruction parameters are not set! Exiting...");
     779           0 :     return 0x0;
     780             :   }  
     781             :   
     782           0 :   return recoParams;
     783           0 : }
     784             : 
     785             : //______________________________________________________________________________
     786             : void 
     787             : AliMUONRecoParam::Show(Int_t runNumber, const char* ocdb)
     788             : {
     789             :   /// Show what we have in the designated OCDB for that run, as far as RecoParams are concerned
     790             :   
     791           0 :   AliCDBManager::Instance()->SetDefaultStorage(ocdb);
     792           0 :   AliCDBManager::Instance()->SetRun(runNumber);
     793             :   
     794           0 :   AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
     795             :   
     796           0 :   if (!entry) return;
     797             :   
     798           0 :   TObject* o = entry->GetObject();
     799             :   
     800           0 :   if ( o->IsA() == TObjArray::Class() ) 
     801             :   {
     802           0 :     TObjArray* array = static_cast<TObjArray*>(o);
     803           0 :     for ( Int_t i = 0; i <= array->GetLast(); ++i ) 
     804             :     {
     805           0 :       AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
     806           0 :       cout << Form("array[%d]=%s %s %s",i,
     807           0 :                    p ? p->ClassName() : "",
     808           0 :                    p ? AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(p->GetEventSpecie())) :"",
     809           0 :                    p ? ( p->IsDefault() ? "default" : "") : "" ) << endl;
     810             :     }
     811           0 :     cout << "=========== dumps below ====== " << endl;
     812             :     
     813           0 :     for ( Int_t i = 0; i <= array->GetLast(); ++i ) 
     814             :     {
     815           0 :       AliDetectorRecoParam* p = static_cast<AliDetectorRecoParam*>(array->At(i));
     816           0 :       if ( p ) p->Print("FULL");
     817             :     }
     818           0 :   }
     819             :   else
     820             :   {
     821           0 :     o->Print();
     822             :   }
     823           0 : }

Generated by: LCOV version 1.11