Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CalDetPIDModule.cxx

Go to the documentation of this file.
00001 
00002 //$Id: CalDetPIDModule.cxx,v 1.3 2003/05/21 16:10:08 bv Exp $
00003 //
00004 //CalDetPIDModule.cxx
00005 //
00006 //Module for identifying particles in the caldet
00007 //
00008 //Author:  B. Rebel 10/2000
00010 #include "TString.h"
00011 
00012 #include "CalDetPIDSR/CalDetPIDModule.h"
00013 #include "CalDetPIDSR/CalDetTOFId.h"
00014 #include "CalDetPIDSR/CalDetCerenkovId.h"
00015 #include "JobControl/JobCModuleRegistry.h"
00016 #include "JobControl/JobCommand.h"
00017 #include "MessageService/MsgService.h"
00018 #include "MinosObjectMap/MomNavigator.h"
00019 #include "CandData/CandRecord.h"
00020 
00021 #include <cassert>
00022 
00023 ClassImp(CalDetPIDModule)
00024 CVSID("$Id: CalDetPIDModule.cxx,v 1.3 2003/05/21 16:10:08 bv Exp $");
00025 
00026 // Declare this module to JobControll. Arguments are:
00027 //  (1) The class name 
00028 //  (2) The human-readable name 
00029 //  (3) A short, human-readable description of what the module does
00030 JOBMODULE(CalDetPIDModule, 
00031           "CalDetPIDModule",
00032           "A module used for particle id in the CalDet");
00033 
00034 //......................................................................
00035 CalDetPIDModule::CalDetPIDModule() :
00036   fBeamMomentum(1.0),
00037   fCkCollectionEfficiency(0.5),
00038   fCkDetectorEfficiency(0.27), //from pdg 2001
00039   fCkLength(6.0),
00040   fCkPedestal(0),
00041   fMassSq(-1.),
00042   fTDCPedestal1(0),
00043   fTDCPedestal2(0),
00044   fTDCGain1(0.1),
00045   fTDCGain2(0.1),
00046   fTOFSeparation(11.0)
00047 {
00048 
00049   MSG("CalDPID", Msg::kDebug) << "CalDetPIDModule::Constructor" << endl;
00050 
00051 }
00052 
00053 //----------------------------------------------------------------------
00054 CalDetPIDModule::~CalDetPIDModule()
00055 {
00056 
00057   MSG("CalDPID", Msg::kInfo) << "CalDetPIDModule::Destructor" << endl;
00058 
00059 }
00060 
00061 //......................................................................
00062 
00063 void CalDetPIDModule::BeginJob()
00064 {
00065   //load in the appropriate root file with histogram here.    
00066   return;
00067 }
00068 
00069 //......................................................................
00070 
00071 JobCResult CalDetPIDModule::Reco(MomNavigator *mom)
00072 {
00073   MSG("CalDPID", Msg::kDebug) << "CalDetPIDModule::Reco\n";
00074 
00075   // Check that mom exists.
00076   assert(mom);
00077 
00078   //find the Raw record fragment in MOM - to be added.
00079   
00080   //get the raw tof digit
00081   RawTOFDigit rtofd;
00082 
00083   //instantiate the CandTOFId and CandCerenkovId objects
00084   CalDetTOFId tof = CalDetTOFId(fTOFSeparation, 
00085                                 fTDCGain1, 
00086                                 fTDCGain2, 
00087                                 fTDCPedestal1, 
00088                                 fTDCPedestal2, 
00089                                 fFirstTOFPaddle, 
00090                                 fSecondTOFPaddle, 
00091                                 rtofd);
00092   //CalDetCerenkovId ck = CalDetCerenkovId(rcd);
00093 
00094   //Get the Mass Squared value
00095   fMassSq = tof.GetParticleMassSquared(fBeamMomentum);
00096 
00097   return JobCResult::kAOK; // All OK...
00098 }
00099 
00100 //......................................................................
00101 
00102 void CalDetPIDModule::HandleCommand(JobCommand *command) 
00103 {
00104   //
00105   //  Purpose:  Method to interpret module commands.
00106   //
00107   //  Arguments:
00108   //    command   in    Command to interpret.
00109   //
00110   //  Return:   n/a
00111   //
00112   //  Commands implemented:
00113   //    Set TOFSeparation  Set the separation to use for tof in meters.
00114   //    Set CerenkovPressure    Set the pressure of the cerenkov detector in bar.
00115   //    Set CerenkovPedestal     Set the pedestal value for cerenkov adc.
00116   //    Set CerenkovCollectionEfficiency  Set the collection efficiency of the cerenkov detector.
00117   //    Set CerenkovDetectorEfficiency  Set the integrated efficiency of the cerenkov detector.
00118   //    Set CerenkovLength      Set the length of the cerenkov detector in meters.
00119   //    Set BeamMomentum   Set the momentum of the beam, enter in GeV/c
00120   //    Set TDCPedestal Set the pedestal value for the TDC
00121   //    Set TDCGain  Set the gain for the TDC
00122   //    Set FirstTOFPaddle  Set which paddle is the first one used for tof info
00123   //    Set SecondTOFPaddel Set which paddle is the second one used for tof info
00124   //
00125 
00126    MSG("CalDPID", Msg::kDebug) << "CalDetPIDModule::HandleCommand" << endl;
00127 
00128    TString cmd = command->PopCmd();
00129    if(cmd == "Set"){   
00130      TString opt = command->PopOpt();
00131      if(opt == "TOFSeparation"){ fTOFSeparation = command->PopFloatOpt();}
00132      else if(opt == "CerenkovPressure"){ fCkPressure = command->PopFloatOpt();}
00133      else if (opt == "CerenkovPedestal"){ fCkPedestal = command->PopIntOpt();}
00134      else if (opt == "CerenkovCollectionEfficiency"){fCkCollectionEfficiency = command->PopFloatOpt();}
00135      else if (opt == "CerenkovDetectorEfficiency"){ fCkDetectorEfficiency = command->PopFloatOpt();}
00136      else if (opt == "CerenkovLength"){ fCkLength = command->PopFloatOpt();}
00137      else if (opt == "BeamMomentum"){ fBeamMomentum = command->PopFloatOpt();}
00138      else if (opt == "TDCPedestal1"){ fTDCPedestal1 = command->PopIntOpt();}
00139      else if (opt == "TDCGain1"){ fTDCGain1 = command->PopFloatOpt();}
00140      else if (opt == "TDCPedestal2"){ fTDCPedestal2 = command->PopIntOpt();}
00141      else if (opt == "TDCGain2"){ fTDCGain2 = command->PopFloatOpt();}
00142      else if (opt == "FirstTOFPaddle"){ fFirstTOFPaddle = command->PopIntOpt();}
00143      else if (opt == "SecondTOFPaddle"){ fSecondTOFPaddle = command->PopIntOpt();}
00144      else {
00145          MSG("CalDPID", Msg::kWarning)<< "CalDetPIDModule: Unrecognized option " << opt << endl;
00146       }
00147    }
00148    else {
00149      MSG("CalDPID", Msg::kWarning) << 
00150        "CalDetPIDModule: Unrecognized command " << cmd << endl;
00151    }
00152 }
00153 
00154 //......................................................................
00155 
00156 void CalDetPIDModule::Help() 
00157 {
00158   MSG("CalDPID", Msg::kInfo) 
00159     << "CalDetPIDModule::Help\n"
00160     <<"CalDetPIDModule is a module which identifies particles "
00161     <<"in the CalDet."
00162     << endl
00163     << "Commands implemented:"
00164     << "Set TOFSeparation  Set the separation to use for tof in meters."
00165     << "Set CerenkovPressure    Set the pressure of the cerenkov detector in bar."
00166     << "Set CerenkovPedestal     Set the pedestal value for cerenkov adc."
00167     << "Set CerenkovCollectionEfficiency  Set the collection efficiency of the cerenkov detector."
00168     << "Set CerenkovDetectorEfficiency  Set the integrated efficiency of the cerenkov detector."
00169     << "Set CerenkovLength      Set the length of the cerenkov detector in meters."
00170     << "Set BeamMomentum   Set the momentum of the beam, enter in GeV/c"
00171     << "Set TDCPedestal Set the pedestal value for the TDC"
00172     << "Set TDCGain  Set the gain for the TDC, in units of ns/tdc"
00173     << "Set FirstTOFPaddle  Set which paddle is the first one used for tof info"
00174     << "Set SecondTOFPaddel Set which paddle is the second one used for tof info"
00175     << endl;
00176 
00177   
00178 }
00179 
00180 

Generated on Mon Feb 15 11:06:27 2010 for loon by  doxygen 1.3.9.1