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

AltDeMuxModule Class Reference

#include <AltDeMuxModule.h>

Inheritance diagram for AltDeMuxModule:

JobCModule List of all members.

Public Member Functions

 AltDeMuxModule ()
 ~AltDeMuxModule ()
void BeginJob ()
JobCResult Reco (MomNavigator *mom)
JobCResult Ana (const MomNavigator *mom)
void HandleCommand (JobCommand *command)
const RegistryDefaultConfig () const
void Config (const Registry &r)
void EndJob ()
void Help ()
void BookHistos ()
void GetFibreLengths ()
bool SelectCleanMuons ()

Private Attributes

Int_t fDraw
bool fDiagnosticPlots
const Char_t * fDeMuxAlg
const Char_t * fHistoFileName
TCanvas * fCanvasAltDeMux
TH2F * fUviewAltDeMux
TH2F * fVviewAltDeMux
AltDeMuxDisplayfAltDeMuxDisplay
std::vector< PlexSEIdAltL * > fPlanesAltLists [MAX_NUMBER_OF_PLANES][2]
std::vector< DeMuxedPairfDeMuxedPairs
AltDeMuxCalcpCalculator
UgliGeomHandlepUgh
Float_t fClearFibreC
Float_t fWLSFibreC
Float_t fScintillatorC
Float_t fClearFibreN
Float_t fWLSFibreN
Float_t fScintillatorN
Int_t fNumberOfStrips
TH1F * fUG
TH1F * fVG
TH1F * fUsdt
TH1F * fVsdt
TH1F * fUsdtH
TH1F * fVsdtH
TH1F * fUsdq
TH1F * fVsdq
TH2F * fVsdqQ
TH2F * fVsdqV
TH1F * fUsdq1
TH1F * fVsdq1
TH1F * fUsdq2
TH1F * fVsdq2
TH1F * fUsdq3
TH1F * fVsdq3
TH1F * fVsdtc
TH1F * fUsdtc
TH2F * fUrat
TH2F * fVrat
TH2F * fUdt
TH2F * fVdt
TH2F * fUcleardt
TH2F * fVcleardt
TH2F * fUwlsdt
TH2F * fVwlsdt
TH2F * fUclearNdt
TH2F * fVclearNdt
TH2F * fUwlsNdt
TH2F * fVwlsNdt
TH2F * fUQdl
TH2F * fVQdl
TH2F * fQ1Q2Good
TH2F * fQ1Q2All
TH2F * fDStripVsPlaneU
TH2F * fDStripVsPlaneV
TPolyLine * fUZFitTSM1
TPolyLine * fVZFitTSM1
TPolyLine * fUZFitSSM1
TPolyLine * fVZFitSSM1
TPolyLine * fUZFitTSM2
TPolyLine * fVZFitTSM2
TPolyLine * fUZFitSSM2
TPolyLine * fVZFitSSM2

Constructor & Destructor Documentation

AltDeMuxModule::AltDeMuxModule  ) 
 

Definition at line 62 of file AltDeMuxModule.cxx.

References AlgHandle::GetAlgConfig(), AlgFactory::GetAlgHandle(), AlgFactory::GetInstance(), Registry::LockKeys(), Registry::LockValues(), MSG, AlgFactory::Register(), Registry::Set(), and Registry::UnLockValues().

00062                                :
00063   fDraw(0),
00064   fDeMuxAlg("AlgAltDeMux"),
00065   fHistoFileName("altDeMux.root")
00066 {
00067  
00068   AlgFactory &af = AlgFactory::GetInstance();
00069 
00070   
00071   af.Register("AlgAltDeMux", "default", "libAltDeMux.so", "AlgConfig");
00072   AlgHandle ah = af.GetAlgHandle(fDeMuxAlg, "default");
00073 
00074   //get the AlgConfig class and set some variables for demuxing
00075   AlgConfig &acd = ah.GetAlgConfig();
00076   acd.UnLockValues();
00077    
00078   acd.Set("XTalkLowPEFraction", 0.1);
00079   acd.Set("XTalkFraction", 0.025);
00080   acd.Set("XTalkLowPECut", 1.5);
00081   
00082   acd.LockValues();
00083   acd.LockKeys();
00084 
00085   if(fDraw==0)fDiagnosticPlots = false;
00086   if(fDraw!=0)fDiagnosticPlots = true;
00087   fDiagnosticPlots = false;
00088 
00089   MSG("AltDeMuxModule", Msg::kInfo) << "AltDeMuxModule::Constructor" << endl;
00090   Float_t fScintillatorN = 1.79;  
00091   Float_t fWLSFibreN     = 1.92; 
00092   Float_t fClearFibreN   = 1.82;  
00093   // velocities of light in m/ns
00094   fClearFibreC   = 0.30/fClearFibreN;
00095   fWLSFibreC     = 0.30/fWLSFibreN;
00096   fScintillatorC = 0.30/fScintillatorN;
00097   //  
00098   fNumberOfStrips = 192;
00099   fDiagnosticPlots = true;
00100 
00101   pCalculator = new AltDeMuxCalc();
00102   pCalculator->SetClearFibreC(fClearFibreC);
00103   pCalculator->SetWLSFibreC(fWLSFibreC);
00104   pCalculator->SetScintillatorC(fScintillatorC);
00105   pCalculator->SetNumberOfStrips(fNumberOfStrips);
00106 
00107   fUZFitSSM1= NULL;
00108   fUZFitSSM2= NULL;
00109   fUZFitTSM1= NULL;
00110   fUZFitTSM2= NULL;
00111   fVZFitSSM1= NULL;
00112   fVZFitSSM2= NULL;
00113   fVZFitTSM1= NULL;
00114   fVZFitTSM2= NULL;
00115 
00116 
00117 
00118   this->BookHistos();
00119   
00120 }

AltDeMuxModule::~AltDeMuxModule  ) 
 

Definition at line 663 of file AltDeMuxModule.cxx.

References MSG.

00664 {
00665   MSG("JobC", Msg::kDebug) << "AltDeMuxModule::Destructor" << endl;
00666   //  if(fDeMuxFile) delete fDeMuxFile;
00667 }


Member Function Documentation

JobCResult AltDeMuxModule::Ana const MomNavigator mom  )  [virtual]
 

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 740 of file AltDeMuxModule.cxx.

References ALG_EAST, ALG_WEST, DeMuxedPair::altListE, DeMuxedPair::altListW, AltDeMuxCalc::CalcBestEastWest(), fDeMuxedPairs, fPlanesAltLists, PlexSEIdAltL::GetBestSEId(), PlexSEIdAltL::GetBestWeight(), CandHandle::GetDaughterIterator(), CandDeMuxDigitHandle::GetDeMuxDigitFlagWord(), PlexSEIdAltL::GetEnd(), GetFibreLengths(), MomNavigator::GetFragment(), PlexSEIdAltL::GetPlane(), PlexSEIdAltL::GetPlaneView(), CandDigitHandle::GetPlexSEIdAltLWritable(), PlexStripEndId::GetStrip(), RecMinos::GetVldContext(), PlexSEIdAltL::IsVetoShield(), MSG, DeMuxedPair::orthogonalStripFromTiming, AltDeMuxCalc::PairQCor(), DeMuxedPair::pairQCor, pCalculator, pUgh, SelectCleanMuons(), AltDeMuxCalc::SetEast(), AltDeMuxCalc::SetPlane(), AltDeMuxCalc::SetUgli(), AltDeMuxCalc::SetView(), AltDeMuxCalc::SetWest(), AltDeMuxCalc::SigmaDQ(), DeMuxedPair::status, AltDeMuxCalc::StripAim(), DeMuxedPair::uniqueGroupID, and DeMuxedPair::weightQ.

00741 {
00742   MSG("JobC", Msg::kInfo) << "AltDeMuxModule::Ana" << endl;
00743 
00744   // if the event displat has been asked for - fraw it.
00745   //if(fDiagnosticPlots)fAltDeMuxDisplay->Ana(mom);
00746 
00747   JobCResult result(JobCResult::kPassed);
00748   // Find PrimaryCandidateRecord fragment in MOM.
00749   CandRecord* candrecord = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord","PrimaryCandidateRecord"));
00750   
00751   if (candrecord == 0) {
00752     MSG("AltDeMuxModule", Msg::kWarning) << " AltDeMuxModule::Ana No PrimaryCandidateRecord in MOM." << endl;
00753     return JobCResult::kError;
00754   }
00755 
00756 
00757 
00758 
00759   fDeMuxedPairs.erase(fDeMuxedPairs.begin(),fDeMuxedPairs.end());
00760   for(UInt_t i=0; i<500;i++){
00761     fPlanesAltLists[i][ALG_EAST].erase(fPlanesAltLists[i][ALG_EAST].begin(),fPlanesAltLists[i][ALG_EAST].end());
00762     fPlanesAltLists[i][ALG_WEST].erase(fPlanesAltLists[i][ALG_WEST].begin(),fPlanesAltLists[i][ALG_WEST].end());
00763   }
00764 
00765   
00766   // Find PrimaryCandidateRecord fragment in MOM.
00767   const CandDeMuxDigitListHandle *canddigit = 
00768     DataUtil::GetCandidate<CandDeMuxDigitListHandle>(mom,
00769                                                      "CandDeMuxDigitListHandle", 
00770                                                      "altdemux");
00771   if (canddigit == 0) {
00772     MSG("MyAna",Msg::kWarning) << "Failed to get CandDeMuxDigitListHandle!\n";
00773     return JobCResult::kFailed;
00774   }
00775 
00776 
00777   // get handle to UgliGeometry
00778   const VldContext* vldc = candrecord->GetVldContext();
00779   UgliGeomHandle ugh(*vldc); 
00780   pUgh = &ugh;
00781   pCalculator->SetUgli(pUgh);
00782 
00783   CandDeMuxDigitHandleItr cdhItr(canddigit->GetDaughterIterator());
00784   
00785   PlexSEIdAltL* paltlist;
00786 
00787   Int_t ndigits = 0;
00788   //  Double_t fAbsTime = canddigit->GetAbsTime()*1.0E9;
00789 
00790   while ( CandDeMuxDigitHandle *cdh = cdhItr() ) {
00791     // for each digit
00792     //    Double_t rawTime = cdh->GetTime(CalTimeType::kNone)*1.0E9;
00793     // Double_t corTime = cdh->GetTime(CalTimeType::kT0)*1.0E9;
00794     paltlist = &(cdh->GetPlexSEIdAltLWritable());
00795     Float_t plane = paltlist->GetPlane();
00796     //    cout << plane << " : " << rawTime << " : " << corTime << " : " << corTime-rawTime << endl;;
00797     if(!paltlist->IsVetoShield()){
00798       if(cdh->GetDeMuxDigitFlagWord()==0){  
00799         ndigits++;
00800         if(paltlist->GetBestWeight()>0.99){
00801           Int_t  iplane = static_cast<int>(plane);
00802           if(cdh->GetDeMuxDigitFlagWord()==false){
00803             if(paltlist->GetEnd()==StripEnd::kEast){
00804               fPlanesAltLists[iplane][ALG_EAST].push_back(paltlist);
00805             }
00806             if(paltlist->GetEnd()==StripEnd::kWest){
00807               fPlanesAltLists[iplane][ALG_WEST].push_back(paltlist);
00808             }
00809           }
00810         }
00811       }
00812     }
00813   }
00814   
00815   cout << "GetFibreLengths" << endl;
00816   this->GetFibreLengths();
00817   cout << "GetFibreLengths DONE" << endl;
00818 
00819   cout << "ALTDEMUXMODULE NDIGITS : " << ndigits << endl;
00820 
00821   Int_t npairs = 0;
00822   Int_t   fUniqueDeMuxedGroupID;
00823   vector <PlexSEIdAltL*>::iterator literE;
00824   vector <PlexSEIdAltL*>::iterator literW;
00825   for(Int_t iplane = 0; iplane <MAX_NUMBER_OF_PLANES; iplane++){
00826     if(fPlanesAltLists[iplane][ALG_EAST].size()&&fPlanesAltLists[iplane][ALG_WEST].size()){
00827       literE = fPlanesAltLists[iplane][ALG_EAST].begin();
00828       while (literE != fPlanesAltLists[iplane][ALG_EAST].end()){
00829         Int_t iStripE = (*literE)->GetBestSEId().GetStrip();
00830         literW = fPlanesAltLists[iplane][ALG_WEST].begin();
00831         while ( literW != fPlanesAltLists[iplane][ALG_WEST].end()){
00832           Int_t iStripW = (*literW)->GetBestSEId().GetStrip();
00833           if(iStripE==iStripW){
00834             npairs++;
00835             DeMuxedPair thisPair;
00836             thisPair.status   = true;
00837             thisPair.altListE = *literE;
00838             thisPair.altListW = *literW;
00839             PlaneView::PlaneView_t kView = (*literE)->GetPlaneView();
00840             pCalculator->SetPlane(iplane);
00841             pCalculator->SetView(kView);
00842             pCalculator->SetEast(*literE,iStripE);
00843             pCalculator->SetWest(*literW,iStripW);
00844             pCalculator->CalcBestEastWest();
00845             if(fabs(pCalculator->SigmaDQ())<3.0){
00846               thisPair.orthogonalStripFromTiming = pCalculator->StripAim();
00847               thisPair.uniqueGroupID = fUniqueDeMuxedGroupID;
00848               thisPair.weightQ = 1.0;
00849               thisPair.pairQCor = pCalculator->PairQCor();
00850               fDeMuxedPairs.push_back(thisPair);
00851               fUniqueDeMuxedGroupID++;
00852             }
00853           }
00854           literW++;
00855         }
00856         literE++;
00857       }
00858     }
00859   }
00860   cout << "ALTDEMUXMODULE NPAIRS : " << npairs << endl;
00861 
00862   this->SelectCleanMuons();
00863 
00864   //this->TimeAnalysis();
00865 
00866   return result;
00867 }

void AltDeMuxModule::BeginJob  )  [virtual]
 

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 671 of file AltDeMuxModule.cxx.

References MSG.

00672 {  // Set Up Canvases
00673 
00674   MSG("JobC", Msg::kInfo) << "AltDeMuxModule::Begin" << endl;
00675  
00676   // if requested draw canvas - useful visual debugging tool
00677 
00678   //if(fDraw)fAltDeMuxDisplay = new AltDeMuxDisplay();
00679 
00680   return;
00681 }

void AltDeMuxModule::BookHistos  ) 
 

Definition at line 123 of file AltDeMuxModule.cxx.

References fDStripVsPlaneU, fDStripVsPlaneV, fQ1Q2All, fQ1Q2Good, fUcleardt, fUclearNdt, fUdt, fUG, fUQdl, fUrat, fUsdq, fUsdq1, fUsdq2, fUsdq3, fUsdt, fUsdtc, fUsdtH, fUwlsdt, fUwlsNdt, fVcleardt, fVclearNdt, fVdt, fVG, fVQdl, fVrat, fVsdq, fVsdq1, fVsdq2, fVsdq3, fVsdqQ, fVsdqV, fVsdt, fVsdtc, fVsdtH, fVwlsdt, and fVwlsNdt.

00123                                {
00124 
00125   fQ1Q2Good=new TH2F("fQ1Q2Good","Q1 vs. Q2",200, 0.0, 20.0, 200, 0.0, 20.);
00126   fQ1Q2All=new TH2F("fQ1Q2All",  "Q1 vs. Q2",200, 0.0, 20.0, 200, 0.0, 20.);
00127   fUrat=new TH2F("fUrat","rat vs plane",96, 0., 192., 100, -1.0, 1.0);
00128   fVrat=new TH2F("fVrat","rat vs plane",96, 0., 192., 100, -1.0, 1.0);
00129   fUQdl=new TH2F("fUQdl","qE/qW vs le-lw",100, -10., 10., 100, 0.0, 10.0);
00130   fVQdl=new TH2F("fVQdl","qE/qW vs le-lw",100, -10., 10., 100, 0.0, 10.0);
00131   fDStripVsPlaneU=new TH2F("fDStripVsPlaneU","dstrip vs plane",500,0.0,500.0,       100,-50.,50.);
00132   fDStripVsPlaneV=new TH2F("fDStripVsPlaneV","dstrip vs plane",500,0.0,500.0,
00133     100,-50.,50.);
00134   fUdt=new TH2F("fUdt","dt vs plane",96, 0., 192., 100, -50.0, 50.0);
00135   fVdt=new TH2F("fVdt","dt vs plane",96, 0., 192., 100, -50.0, 50.0);
00136   fUwlsdt=new TH2F("fUwlsdt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00137   fVwlsdt=new TH2F("fVwlsdt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00138   fUcleardt=new TH2F("fUcleardt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00139   fVcleardt=new TH2F("fVcleardt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00140   fUwlsNdt=new TH2F("fUwlsNdt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00141   fVwlsNdt=new TH2F("fVwlsNdt","dt vs plane",100, -2., 2., 100, -50.0, 50.0);
00142   fUclearNdt=new TH2F("fUclearNdt","Ndt vs plane",100, -2., 2., 100, -50.0, 50.0);
00143   fVclearNdt=new TH2F("fVclearNdt","Ndt vs plane",100, -2., 2., 100, -50.0, 50.0);
00144 
00145   fUG=new TH1F("fUG",  "sigmaQU ",100, -5.0, 5.0);
00146   fVG=new TH1F("fVG",  "sigmaQV ",100, -5.0, 5.0);
00147   fUsdt=new TH1F("fUsdt",  "sigmatV ",100, -50.0, 50.0);
00148   fVsdt=new TH1F("fVsdt",  "sigmatV ",100, -50.0, 50.0);
00149   fUsdtH=new TH1F("fUsdtH",  "sigmatV ",100, -50.0, 50.0);
00150   fVsdtH=new TH1F("fVsdtH",  "sigmatV ",100, -50.0, 50.0);
00151   fUsdq=new TH1F("fUsdq",  "sigma q U",100, -10.0, 10.0);
00152   fVsdq=new TH1F("fVsdq",  "sigma q V",100, -10.0, 10.0);
00153   fVsdqQ=new TH2F("fVsdqQ",  "sigma q V vs Q",20,0.,1000.,100, -10.0, 10.0);
00154   fVsdqV=new TH2F("fVsdqV",  "sigma q V vs V",20,0.,192.,100, -10.0, 10.0);
00155   fUsdq1=new TH1F("fUsdq1",  "sigma q U",100, -10.0, 10.0);
00156   fVsdq1=new TH1F("fVsdq1",  "sigma q V",100, -10.0, 10.0);
00157   fUsdq2=new TH1F("fUsdq2",  "sigma q U",100, -10.0, 10.0);
00158   fVsdq2=new TH1F("fVsdq2",  "sigma q V",100, -10.0, 10.0);
00159 
00160   fUsdq3=new TH1F("fUsdq3",  "sigma q U",100, -10.0, 10.0);
00161   fVsdq3=new TH1F("fVsdq3",  "sigma q V",100, -10.0, 10.0);
00162 
00163   fUsdtc=new TH1F("fUsdtc",  "sigmatUc ",100, -50.0, 50.0);
00164   fVsdtc=new TH1F("fVsdtc",  "sigmatVc ",100, -50.0, 50.0);
00165 
00166 
00167   return;
00168 }

void AltDeMuxModule::Config const Registry r  )  [virtual]
 

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 974 of file AltDeMuxModule.cxx.

References fDeMuxAlg, fDraw, Registry::Get(), and MSG.

00975 {
00976   Int_t tmpint; 
00977   //Double_t tmpdub; 
00978   const char* tmpchar = 0;
00979 
00980   if(r.Get("Draw", tmpint)){    fDraw = tmpint;
00981     MSG("AltDeMux", Msg::kInfo) << "AltDeMuxModule::Config\n" << 
00982       "Drawing on/off " << fDraw << endl;
00983   }
00984 
00985   if(r.Get("DeMuxAlg", tmpchar)){
00986     fDeMuxAlg = tmpchar;
00987     MSG("AltDeMux", Msg::kInfo) << "AltDeMuxModule::Config\n" << 
00988       "DeMuxing Algorithm : " << fDeMuxAlg << endl;
00989   }
00990 
00991   return;
00992 }

const Registry & AltDeMuxModule::DefaultConfig  )  const [virtual]
 

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 908 of file AltDeMuxModule.cxx.

References Registry::LockValues(), MSG, Registry::Set(), and Registry::UnLockValues().

00909 {
00910   //  Commands implemented:
00911   //    Set TestToMake  Set the test to make to obtain a figure of merit - fraction of
00912   //                    digits within n strips from a track, fraction of mated signal
00913   //                    DigitsAlongTrack, and MatedSignalFraction respectively
00914   //    Set DataType    Set the type of data to test - MonteCarlo or FarDetector
00915   //    Set MatedSignalLimit  Set the lower limit for fraction of signal coming from opposite
00916   //                          sides of the same strip in a plane.
00917   //    Set DeltaStripsFromTrack  Set the number of strips a digit can be off from a track and
00918   //                              still be considered along that track.
00919   //
00920   //  see http://beaker.astro.indiana.edu/brebel/demux_notes/how_to_demux.html for details
00921 
00922   //   int itrue = 1;  // work around for lack of bool in registry
00923   // int ifalse = 0; // work around for lack of bool in registry
00924 
00925    MSG("JobC", Msg::kDebug) << "AltDeMuxModule::DefaultConfig" << endl;
00926 
00927    static Registry r;
00928  
00929    r.UnLockValues();
00930    
00931    r.Set("Draw","fDraw");
00932    r.Set("DeMuxAlg","fDeMuxAlg");
00933 
00934    r.LockValues();
00935       
00936    return r;
00937 }

void AltDeMuxModule::EndJob  )  [virtual]
 

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 1008 of file AltDeMuxModule.cxx.

References fDStripVsPlaneU, fDStripVsPlaneV, fQ1Q2All, fQ1Q2Good, fUcleardt, fUclearNdt, fUdt, fUG, fUQdl, fUrat, fUsdq, fUsdq1, fUsdq2, fUsdq3, fUsdt, fUsdtc, fUsdtH, fUwlsdt, fUwlsNdt, fVcleardt, fVclearNdt, fVdt, fVG, fVQdl, fVrat, fVsdq, fVsdq1, fVsdq2, fVsdq3, fVsdqQ, fVsdqV, fVsdt, fVsdtc, fVsdtH, fVwlsdt, and fVwlsNdt.

01009 {
01010 
01011   TFile *hfile = new TFile("AltDeMuxHistos.root","recreate");
01012  
01013   fQ1Q2All->TH2F::Write();
01014   fQ1Q2Good->TH2F::Write();
01015   fUrat->TH2F::Write();
01016   fVrat->TH2F::Write();
01017   fUdt->TH2F::Write();
01018   fVdt->TH2F::Write();
01019   fUQdl->TH2F::Write();
01020   fVQdl->TH2F::Write();
01021   fUwlsdt->TH2F::Write();
01022   fVwlsdt->TH2F::Write();
01023   fUcleardt->TH2F::Write();
01024   fVcleardt->TH2F::Write();
01025   fUwlsNdt->TH2F::Write();
01026   fVwlsNdt->TH2F::Write();
01027   fUclearNdt->TH2F::Write();
01028   fVclearNdt->TH2F::Write();
01029   fUG->TH1F::Write();
01030   fVG->TH1F::Write();
01031   fUsdt->TH1F::Write();
01032   fVsdt->TH1F::Write();
01033   fUsdtH->TH1F::Write();
01034   fVsdtH->TH1F::Write();
01035   fUsdq->TH1F::Write();
01036   fVsdq->TH1F::Write();
01037   fVsdqQ->TH2F::Write();
01038   fVsdqV->TH2F::Write();
01039   fUsdq1->TH1F::Write();
01040   fVsdq1->TH1F::Write();
01041   fUsdq2->TH1F::Write();
01042   fVsdq2->TH1F::Write();
01043   fUsdq3->TH1F::Write();
01044   fVsdq3->TH1F::Write();
01045   fVsdtc->TH1F::Write();
01046   fUsdtc->TH1F::Write();
01047   fDStripVsPlaneU->TH2F::Write();
01048   fDStripVsPlaneV->TH2F::Write();
01049 
01050   hfile->Close();
01051   delete hfile;
01052 
01053   return;
01054 }

void AltDeMuxModule::GetFibreLengths  ) 
 

Definition at line 942 of file AltDeMuxModule.cxx.

References fPlanesAltLists, UgliGeomHandle::GetStripHandle(), UgliStripHandle::IsValid(), MSG, pCalculator, pUgh, AltDeMuxCalc::SetFibreLengthE(), and AltDeMuxCalc::SetFibreLengthW().

Referenced by Ana().

00943 {
00944   // Store the fibre lengths for strips in this event.  
00945 
00946   UgliStripHandle ush;
00947 
00948   vector <PlexSEIdAltL*>::iterator literA;
00949   MSG("AlgAltDeMux", Msg::kVerbose) << "AlgAltDeMuxBase::GetFibreLengths " << endl;
00950  
00951   for(Int_t iplane=0;iplane<MAX_NUMBER_OF_PLANES;iplane++){
00952     for(Int_t iew = ALG_EAST; iew <= ALG_WEST; iew++){
00953       if(fPlanesAltLists[iplane][iew].size()>0){
00954         literA = fPlanesAltLists[iplane][iew].begin();
00955         while (literA != fPlanesAltLists[iplane][iew].end()){
00956           (*literA)->SetFirst();
00957           while( (*literA)->IsValid() ){
00958             ush = pUgh->GetStripHandle((*literA)->GetCurrentSEId());
00959             if(!ush.IsValid())MSG("AlgAltDeMux", Msg::kFatal) << "AlgAltDeMuxBase::GetFibreLengths => UgliStripHandle NOT VALID : plane " << iplane << " (Carry on regardless)" <<  endl;
00960             if(iew==ALG_EAST)pCalculator->SetFibreLengthE(iplane,*literA);
00961             if(iew==ALG_WEST)pCalculator->SetFibreLengthW(iplane,*literA);
00962             (*literA)->Next();
00963           }
00964           *literA++;
00965         }
00966       }
00967     }
00968   }
00969   return;
00970 
00971 }

void AltDeMuxModule::HandleCommand JobCommand command  )  [virtual]
 

Implement to handle a JobCommand

Reimplemented from JobCModule.

Definition at line 871 of file AltDeMuxModule.cxx.

References MSG, JobCommand::PopCmd(), and JobCommand::PopOpt().

00872 {
00873   //
00874   //  Purpose:  Method to interpret module commands.
00875   //
00876   //  Arguments:
00877   //    command   in    Command to interpret.
00878   //
00879   //  Return:   n/a
00880   //
00881   //  Commands implemented:
00882   //    Set TestToMake  Set the test to make to obtain a figure of merit - fraction of
00883   //                    digits within n strips from a track, fraction of mated signal
00884   //                    DigitsAlongTrack, and MatedSignalFraction respectively
00885   //    Set DataType    Set the type of data to test - MonteCarlo or FarDetector
00886   //    Set MatedSignalLimit  Set the lower limit for fraction of signal coming from opposite
00887   //                          sides of the same strip in a plane.
00888   //    Set DeltaStripsFromTrack  Set the number of strips a digit can be off from a track and
00889   //                              still be considered along that track.
00890   //
00891   //  see http://beaker.astro.indiana.edu/brebel/demux_notes/how_to_demux.html for details
00892 
00893    MSG("AltDeMux", Msg::kDebug) << "AltDeMuxModule::HandleCommand" << endl;
00894 
00895    TString cmd = command->PopCmd();
00896 
00897    if(cmd=="Set"){
00898      TString opt = command->PopOpt();
00899    }
00900 
00901    return;
00902 }

void AltDeMuxModule::Help  )  [virtual]
 

Implement to spew some useful help to cout

Reimplemented from JobCModule.

Definition at line 998 of file AltDeMuxModule.cxx.

References MSG.

00999 {
01000   MSG("JobC", Msg::kInfo) 
01001     << "AltDeMuxModule::Help\n"
01002     <<"AltDeMuxModule is an alternatice demultiplexer events "
01003     <<"for far detector events." << endl
01004     << "THIS IS A VERY PRELIMINARY VERSION"
01005     << endl;
01006 }

JobCResult AltDeMuxModule::Reco MomNavigator mom  )  [virtual]
 

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 685 of file AltDeMuxModule.cxx.

References fDeMuxAlg, CandRecord::FindCandHandle(), AlgFactory::GetAlgHandle(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), MSG, AlgHandle::RunAlg(), JobCResult::SetError(), and JobCResult::SetFailed().

00686 {
00687 
00688   MSG("AltDeMuxModule", Msg::kInfo) << "AltDeMuxModule::Reco" << endl;
00689 
00690   JobCResult result(JobCResult::kPassed);
00691 
00692   // Check that mom exists.
00693   assert(mom);
00694 
00695   // Find PrimaryCandidateRecord fragment in MOM.
00696   CandRecord *candrec = dynamic_cast<CandRecord *>
00697     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00698   if (candrec == 0) {
00699     result.SetError().SetFailed();
00700     return result;
00701   }
00702 
00703   //  Find Raw Data CandDeMuxDigitList fragment in PrimaryCandidateRecord.
00704   MSG("AltDeMuxModule", Msg::kInfo) << "got cand record" << endl;
00705   //  Find Raw Data CandDeMuxDigitList fragment in PrimaryCandidateRecord.
00706 
00707   //  CandDeMuxDigitListHandle *crdlh = dynamic_cast<CandDeMuxDigitListHandle *>
00708   //   (candrec->FindCandHandle("CandDeMuxDigitListHandle", "canddigitlist"));
00709   CandDigitListHandle *crdlh = dynamic_cast<CandDigitListHandle *>
00710     (candrec->FindCandHandle("CandDigitListHandle", "canddigitlist"));
00711   if (crdlh == 0) {
00712     MSG("AltDeMuxModule", Msg::kInfo) << "crdlh = 0" << endl;
00713     result.SetError().SetFailed();
00714     return result;
00715    }
00716     
00717 
00718   cout << " ASKING FACTORY FOR : " << fDeMuxAlg << endl;
00719 
00720   AlgFactory &af = AlgFactory::GetInstance();
00721   AlgHandle ah = af.GetAlgHandle(fDeMuxAlg, "default");
00722     
00723   CandContext cx(this, mom);
00724   //cx.SetDataIn(status);
00725   
00726   MSG("AltDeMuxModule", Msg::kInfo) << "starting demux algorithm " << endl;
00727   ah.RunAlg(*crdlh, cx);
00728   MSG("AltDeMuxModule", Msg::kInfo) << "finished demux algorithm " << endl;
00729   
00730   
00731   MSG("AltDeMuxModule", Msg::kInfo) << "Event DeMuxed" << endl;
00732   
00733   return result;
00734 }

bool AltDeMuxModule::SelectCleanMuons  ) 
 

Definition at line 171 of file AltDeMuxModule.cxx.

References AltDeMuxCalc::CalcBestEastWest(), AltDeMuxCalc::CalcDt(), AltDeMuxCalc::DT(), fClearFibreC, fClearFibreN, fDeMuxedPairs, fDStripVsPlaneU, fDStripVsPlaneV, fScintillatorC, fScintillatorN, fUcleardt, fUclearNdt, fUdt, fUsdt, fUsdtc, fUsdtH, fUwlsdt, fUwlsNdt, fUZFitSSM1, fUZFitSSM2, fUZFitTSM1, fUZFitTSM2, fVcleardt, fVclearNdt, fVdt, fVsdt, fVsdtH, fVwlsdt, fVwlsNdt, fVZFitSSM1, fVZFitSSM2, fVZFitTSM1, fVZFitTSM2, fWLSFibreC, fWLSFibreN, AltDeMuxCalc::GetClearE(), AltDeMuxCalc::GetClearW(), AltDeMuxCalc::GetTE(), AltDeMuxCalc::GetTW(), AltDeMuxCalc::GetWlsE(), AltDeMuxCalc::GetWlsW(), pCalculator, AltDeMuxCalc::SetEast(), AltDeMuxCalc::SetPlane(), AltDeMuxCalc::SetView(), AltDeMuxCalc::SetWest(), and AltDeMuxCalc::StripAim().

Referenced by Ana().

00172 {
00173 
00174   Float_t NU=0;
00175   Float_t NV=0;
00176   Float_t NUold=0;
00177   Float_t NVold=0;
00178   Float_t xU=0;
00179   Float_t xV=0;
00180   Float_t xxU=0;
00181   Float_t xxV=0;
00182   Float_t yU=0;
00183   Float_t yV=0;
00184   Float_t yUT=0;
00185   Float_t yVT=0;
00186   Float_t xyU=0;
00187   Float_t xyV=0;
00188   Float_t xyUT=0;
00189   Float_t xyVT=0;
00190   Float_t detU;
00191   Float_t detV;
00192   Float_t mU;
00193   Float_t cU;
00194   Float_t mV;
00195   Float_t cV;
00196   Float_t mUT;
00197   Float_t cUT;
00198   Float_t mVT;
00199   Float_t cVT;
00200   Float_t xp[2];
00201   Float_t yp[2];
00202 
00203   Int_t lowestUplane=999;
00204   Int_t lowestVplane=999;
00205   Int_t highestUplane=-999;
00206   Int_t highestVplane=-999;
00207   cout << " IN ALTDEMUXMODULE::SELECTCLEANMUONS  " << endl;
00208 
00209 
00210   for(UInt_t ipair=0;ipair<fDeMuxedPairs.size();ipair++){
00211     Int_t iplane = fDeMuxedPairs[ipair].altListE->GetPlane();
00212     PlaneView::PlaneView_t kView = fDeMuxedPairs[ipair].altListE->GetPlaneView();
00213     if(kView==PlaneView::kU){
00214       if(iplane<lowestUplane)lowestUplane=iplane;
00215       if(iplane>highestUplane)highestUplane=iplane;
00216     }
00217     if(kView==PlaneView::kV){
00218       if(iplane<lowestVplane)lowestVplane=iplane;
00219       if(iplane>highestVplane)highestVplane=iplane;
00220     }
00221   }
00222   
00223   for(UInt_t ipair=0;ipair<fDeMuxedPairs.size();ipair++){
00224     if(fDeMuxedPairs[ipair].altListE->GetDemuxVetoFlag()==false &&
00225        fDeMuxedPairs[ipair].altListW->GetDemuxVetoFlag()==false){
00226       Int_t iplane = fDeMuxedPairs[ipair].altListE->GetPlane();
00227       PlaneView::PlaneView_t kView = fDeMuxedPairs[ipair].altListE->GetPlaneView();
00228       pCalculator->SetPlane(iplane);
00229       pCalculator->SetView(kView);
00230       Int_t istrip = fDeMuxedPairs[ipair].altListE->GetBestSEId().GetStrip();
00231       pCalculator->SetEast(fDeMuxedPairs[ipair].altListE,istrip);
00232       pCalculator->SetWest(fDeMuxedPairs[ipair].altListW,istrip);
00233       pCalculator->CalcBestEastWest();
00234       Int_t jplane = iplane;
00235       if(jplane>249)jplane+=20;
00236       if(kView==PlaneView::kV){
00237         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00238           NV  += 1.;
00239           xV  += jplane;
00240           xxV += jplane*jplane;
00241           yV  += istrip;
00242           yVT += pCalculator->StripAim();
00243           xyV += jplane*istrip;
00244           xyVT+= jplane*pCalculator->StripAim();
00245         }else{
00246           cout << "Ignoring hits in plane : " << iplane << endl;
00247         }
00248       }
00249       if(kView==PlaneView::kU){
00250         if(iplane>=lowestVplane-1&&iplane<=highestVplane+1){
00251           NU  += 1.;
00252           xU  += jplane;
00253           xxU += jplane*jplane;
00254           yU  += istrip;
00255           yUT += pCalculator->StripAim();
00256           xyU += jplane*istrip;
00257           xyUT+= jplane*pCalculator->StripAim();
00258         }else{
00259           cout << "Ignoring hits in plane : " << iplane << endl;
00260         }
00261       }
00262     }
00263   }
00264   NUold = NU;
00265   NVold = NV;
00266   
00267   detU = xxU*NU-xU*xU;
00268   detV = xxV*NV-xV*xV;
00269   if(detU>0){
00270     mU = (NU*xyU - xU*yU)/detU;
00271     cU = (-xU*xyU + xxU*yU)/detU;
00272     xp[0] = 0;
00273     xp[1] = 249.;
00274     yp[0] = cU;
00275     yp[1] = mU*249.+cU;
00276     if(fUZFitSSM1)delete fUZFitSSM1;
00277     fUZFitSSM1 = new TPolyLine(2,xp,yp);
00278     fUZFitSSM1->SetLineColor(4);
00279     fUZFitSSM1->SetLineStyle(1);
00280     fUZFitSSM1->SetLineWidth(2);
00281     xp[0] = 249;
00282     xp[1] = 500.;
00283     yp[0] = mU*269.+cU;
00284     yp[1] = mU*520.+cU;
00285     if(fUZFitSSM2)delete fUZFitSSM2;
00286     fUZFitSSM2 = new TPolyLine(2,xp,yp);
00287     fUZFitSSM2->SetLineColor(4);
00288     fUZFitSSM2->SetLineStyle(1);
00289     fUZFitSSM2->SetLineWidth(2);
00290 
00291     mVT = (NU*xyUT - xU*yUT)/detU;
00292     cVT = (-xU*xyUT + xxU*yUT)/detU;
00293     xp[0] = 0;
00294     xp[1] = 249.;
00295     yp[0] = cVT;
00296     yp[1] = mVT*249.+cVT;
00297     if(fVZFitTSM1)delete fVZFitTSM1;
00298     fVZFitTSM1 = new TPolyLine(2,xp,yp);
00299     fVZFitTSM1->SetLineColor(4);
00300     fVZFitTSM1->SetLineStyle(2);
00301     fVZFitTSM1->SetLineWidth(2);
00302     xp[0] = 249;
00303     xp[1] = 500.;
00304     yp[0] = mVT*269.+cVT;
00305     yp[1] = mVT*520.+cVT;
00306     if(fVZFitTSM2)delete fVZFitTSM2;
00307     fVZFitTSM2 = new TPolyLine(2,xp,yp);
00308     fVZFitTSM2->SetLineColor(4);
00309     fVZFitTSM2->SetLineStyle(2);
00310     fVZFitTSM2->SetLineWidth(2);
00311   }
00312 
00313   if(detV>0){
00314     mV = (NV*xyV - xV*yV)/detV;
00315     cV = (-xV*xyV + xxV*yV)/detV;
00316     xp[0] = 0;
00317     xp[1] = 249.;
00318     yp[0] = cV;
00319     yp[1] = mV*249.+cV;
00320     if(fVZFitSSM1)delete fVZFitSSM1;
00321     fVZFitSSM1 = new TPolyLine(2,xp,yp);
00322     fVZFitSSM1->SetLineColor(4);
00323     fVZFitSSM1->SetLineStyle(1);
00324     fVZFitSSM1->SetLineWidth(2);
00325     xp[0] = 249;
00326     xp[1] = 500.;
00327     yp[0] = mV*269.+cV;
00328     yp[1] = mV*520.+cV;
00329     if(fVZFitSSM2)delete fVZFitSSM2;
00330     fVZFitSSM2 = new TPolyLine(2,xp,yp);
00331     fVZFitSSM2->SetLineColor(4);
00332     fVZFitSSM2->SetLineStyle(1);
00333     fVZFitSSM2->SetLineWidth(2);
00334 
00335     mUT = (NV*xyVT - xV*yVT)/detV;
00336     cUT = (-xV*xyVT + xxV*yVT)/detV;
00337     xp[0] = 0;
00338     xp[1] = 249.;
00339     yp[0] = cUT;
00340     yp[1] = mUT*249.+cUT;
00341     if(fUZFitTSM1)delete fUZFitTSM1;
00342     fUZFitTSM1 = new TPolyLine(2,xp,yp);
00343     fUZFitTSM1->SetLineColor(4);
00344     fUZFitTSM1->SetLineStyle(2);
00345     fUZFitTSM1->SetLineWidth(2);
00346     xp[0] = 249;
00347     xp[1] = 500.;
00348     yp[0] = mUT*269.+cUT;
00349     yp[1] = mUT*520.+cUT;
00350     if(fUZFitTSM2)delete fUZFitTSM2;
00351     fUZFitTSM2 = new TPolyLine(2,xp,yp);
00352     fUZFitTSM2->SetLineColor(4);
00353     fUZFitTSM2->SetLineStyle(2);
00354     fUZFitTSM2->SetLineWidth(2);
00355   }
00356 
00357 
00358   Float_t chi2U = 0;
00359   Float_t chi2V = 0;
00360   Float_t deltaStrip;
00361   for(UInt_t ipair=0; ipair<fDeMuxedPairs.size(); ipair++){
00362     if(fDeMuxedPairs[ipair].altListE->GetDemuxVetoFlag()==false &&
00363        fDeMuxedPairs[ipair].altListW->GetDemuxVetoFlag()==false){
00364       Int_t iplane = fDeMuxedPairs[ipair].altListE->GetPlane();
00365       pCalculator->SetPlane(iplane);
00366       PlaneView::PlaneView_t kView = fDeMuxedPairs[ipair].altListE->GetPlaneView();
00367       pCalculator->SetView(kView);
00368       Int_t istrip = fDeMuxedPairs[ipair].altListE->GetBestSEId().GetStrip();
00369       pCalculator->SetEast(fDeMuxedPairs[ipair].altListE,istrip);
00370       pCalculator->SetWest(fDeMuxedPairs[ipair].altListW,istrip);
00371       pCalculator->CalcBestEastWest();
00372       //      Int_t isaim = pCalculator->StripAim();
00373       Int_t jplane = iplane;
00374       if(jplane>249)jplane+=20;
00375       
00376       if(kView==PlaneView::kU){
00377         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00378            deltaStrip = (istrip - mU*jplane-cU);
00379           chi2U += deltaStrip*deltaStrip;
00380         }
00381       }
00382       if(kView==PlaneView::kV){
00383         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00384           deltaStrip = (istrip - mV*jplane-cV);
00385           chi2V += deltaStrip*deltaStrip;
00386         }
00387       }
00388       if(fabs(deltaStrip)>15){
00389         fDeMuxedPairs[ipair].altListE->SetDemuxVetoFlag(true);
00390         fDeMuxedPairs[ipair].altListW->SetDemuxVetoFlag(true);
00391         if(kView==PlaneView::kV){
00392           NV  -= 1.;
00393           xV  -= jplane;
00394           xxV -= jplane*jplane;
00395           yV  -= istrip;
00396           yVT -= pCalculator->StripAim();
00397           xyV -= jplane*istrip;
00398           xyVT-= jplane*pCalculator->StripAim();
00399         }
00400         if(kView==PlaneView::kU){
00401           NU  -= 1.;
00402           xU  -= jplane;
00403           xxU -= jplane*jplane;
00404           yU  -= istrip;
00405           yUT -= pCalculator->StripAim();
00406           xyU -= jplane*istrip;
00407           xyUT-= jplane*pCalculator->StripAim();
00408         }
00409       }
00410     }
00411   }
00412 
00413   detU = xxU*NU-xU*xU;
00414   detV = xxV*NV-xV*xV;
00415   if(detU>0){
00416     mU = (NU*xyU - xU*yU)/detU;
00417     cU = (-xU*xyU + xxU*yU)/detU;
00418     xp[0] = 0;
00419     xp[1] = 249.;
00420     yp[0] = cU;
00421     yp[1] = mU*249.+cU;
00422     if(fUZFitSSM1)delete fUZFitSSM1;
00423     fUZFitSSM1 = new TPolyLine(2,xp,yp);
00424     fUZFitSSM1->SetLineColor(4);
00425     fUZFitSSM1->SetLineStyle(1);
00426     fUZFitSSM1->SetLineWidth(2);
00427     xp[0] = 249;
00428     xp[1] = 500.;
00429     yp[0] = mU*269.+cU;
00430     yp[1] = mU*520.+cU;
00431     if(fUZFitSSM2)delete fUZFitSSM2;
00432     fUZFitSSM2 = new TPolyLine(2,xp,yp);
00433     fUZFitSSM2->SetLineColor(4);
00434     fUZFitSSM2->SetLineStyle(1);
00435     fUZFitSSM2->SetLineWidth(2);
00436 
00437     mVT = (NU*xyUT - xU*yUT)/detU;
00438     cVT = (-xU*xyUT + xxU*yUT)/detU;
00439     xp[0] = 0;
00440     xp[1] = 249.;
00441     yp[0] = cVT;
00442     yp[1] = mVT*249.+cVT;
00443     if(fVZFitTSM1)delete fVZFitTSM1;
00444     fVZFitTSM1 = new TPolyLine(2,xp,yp);
00445     fVZFitTSM1->SetLineColor(4);
00446     fVZFitTSM1->SetLineStyle(2);
00447     fVZFitTSM1->SetLineWidth(2);
00448     xp[0] = 249;
00449     xp[1] = 500.;
00450     yp[0] = mVT*269.+cVT;
00451     yp[1] = mVT*520.+cVT;
00452     if(fVZFitTSM2)delete fVZFitTSM2;
00453     fVZFitTSM2 = new TPolyLine(2,xp,yp);
00454     fVZFitTSM2->SetLineColor(4);
00455     fVZFitTSM2->SetLineStyle(2);
00456     fVZFitTSM2->SetLineWidth(2);
00457   }
00458 
00459   if(detV>0){
00460     mV = (NV*xyV - xV*yV)/detV;
00461     cV = (-xV*xyV + xxV*yV)/detV;
00462     xp[0] = 0;
00463     xp[1] = 249.;
00464     yp[0] = cV;
00465     yp[1] = mV*249.+cV;
00466     if(fVZFitSSM1)delete fVZFitSSM1;
00467     fVZFitSSM1 = new TPolyLine(2,xp,yp);
00468     fVZFitSSM1->SetLineColor(4);
00469     fVZFitSSM1->SetLineStyle(1);
00470     fVZFitSSM1->SetLineWidth(2);
00471     xp[0] = 249;
00472     xp[1] = 500.;
00473     yp[0] = mV*269.+cV;
00474     yp[1] = mV*520.+cV;
00475     if(fVZFitSSM2)delete fVZFitSSM2;
00476     fVZFitSSM2 = new TPolyLine(2,xp,yp);
00477     fVZFitSSM2->SetLineColor(4);
00478     fVZFitSSM2->SetLineStyle(1);
00479     fVZFitSSM2->SetLineWidth(2);
00480 
00481     mUT = (NV*xyVT - xV*yVT)/detV;
00482     cUT = (-xV*xyVT + xxV*yVT)/detV;
00483     xp[0] = 0;
00484     xp[1] = 249.;
00485     yp[0] = cUT;
00486     yp[1] = mUT*249.+cUT;
00487     if(fUZFitTSM1)delete fUZFitTSM1;
00488     fUZFitTSM1 = new TPolyLine(2,xp,yp);
00489     fUZFitTSM1->SetLineColor(4);
00490     fUZFitTSM1->SetLineStyle(2);
00491     fUZFitTSM1->SetLineWidth(2);
00492     xp[0] = 249;
00493     xp[1] = 500.;
00494     yp[0] = mUT*269.+cUT;
00495     yp[1] = mUT*520.+cUT;
00496     if(fUZFitTSM2)delete fUZFitTSM2;
00497     fUZFitTSM2 = new TPolyLine(2,xp,yp);
00498     fUZFitTSM2->SetLineColor(4);
00499     fUZFitTSM2->SetLineStyle(2);
00500     fUZFitTSM2->SetLineWidth(2);
00501   }
00502 
00503   chi2U = 0;
00504   chi2V = 0;
00505   for(UInt_t ipair=0; ipair<fDeMuxedPairs.size(); ipair++){
00506     if(fDeMuxedPairs[ipair].altListE->GetDemuxVetoFlag()==false &&
00507        fDeMuxedPairs[ipair].altListW->GetDemuxVetoFlag()==false){
00508       Int_t iplane = fDeMuxedPairs[ipair].altListE->GetPlane();
00509       pCalculator->SetPlane(iplane);
00510       PlaneView::PlaneView_t kView = fDeMuxedPairs[ipair].altListE->GetPlaneView();
00511       pCalculator->SetView(kView);
00512       Int_t istrip = fDeMuxedPairs[ipair].altListE->GetBestSEId().GetStrip();
00513       pCalculator->SetEast(fDeMuxedPairs[ipair].altListE,istrip);
00514       pCalculator->SetWest(fDeMuxedPairs[ipair].altListW,istrip);
00515       pCalculator->CalcBestEastWest();
00516       //      Int_t isaim = pCalculator->StripAim();
00517       Int_t jplane = iplane;
00518       if(jplane>249)jplane+=20;
00519       
00520       if(kView==PlaneView::kU){
00521         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00522           deltaStrip = (istrip - mU*jplane-cU);
00523           chi2U += deltaStrip*deltaStrip;
00524         }
00525       }
00526       if(kView==PlaneView::kV){
00527         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00528           deltaStrip = (istrip - mV*jplane-cV);
00529           chi2V += deltaStrip*deltaStrip;
00530         }
00531       }
00532       if(deltaStrip>15){
00533         fDeMuxedPairs[ipair].altListE->SetDemuxVetoFlag(true);
00534         fDeMuxedPairs[ipair].altListW->SetDemuxVetoFlag(true);
00535         if(kView==PlaneView::kV){
00536           NV  -= 1.;
00537           xV  -= jplane;
00538           xxV -= jplane*jplane;
00539           yV  -= istrip;
00540           yVT -= pCalculator->StripAim();
00541           xyV -= jplane*istrip;
00542           xyVT-= jplane*pCalculator->StripAim();
00543         }
00544         if(kView==PlaneView::kU){
00545           NU  -= 1.;
00546           xU  -= jplane;
00547           xxU -= jplane*jplane;
00548           yU  -= istrip;
00549           yUT -= pCalculator->StripAim();
00550           xyU -= jplane*istrip;
00551           xyUT-= jplane*pCalculator->StripAim();
00552         }
00553       }
00554     }
00555   }
00556 
00557   cout << "AltDeMuxModule : " << "chi2U " << chi2U << " ndof = " << NV-2 << endl;
00558   cout << "AltDeMuxModule : " << "chi2V " << chi2V << " ndof = " << NU-2 << endl;
00559   bool goodMuon = false;
00560   if(NV>10&&NU>10&&chi2U<10.0*NV&&chi2V<10.0*NV)goodMuon = true;
00561   if(!goodMuon)return false;
00562 
00563   cout << "AltDeMuxModule : " << "Selected Good Muon" << endl;
00564 
00565   for(UInt_t ipair=0; ipair<fDeMuxedPairs.size(); ipair++){
00566     if(fDeMuxedPairs[ipair].altListE->GetDemuxVetoFlag()==false &&
00567        fDeMuxedPairs[ipair].altListW->GetDemuxVetoFlag()==false){
00568       bool onTrack = true;
00569       Int_t iplane = fDeMuxedPairs[ipair].altListE->GetPlane();
00570       pCalculator->SetPlane(iplane);
00571       PlaneView::PlaneView_t kView = fDeMuxedPairs[ipair].altListE->GetPlaneView();
00572       pCalculator->SetView(kView);
00573       Int_t istrip = fDeMuxedPairs[ipair].altListE->GetBestSEId().GetStrip();
00574       pCalculator->SetEast(fDeMuxedPairs[ipair].altListE,istrip);
00575       pCalculator->SetWest(fDeMuxedPairs[ipair].altListW,istrip);
00576       pCalculator->CalcBestEastWest();
00577       Int_t isaim = pCalculator->StripAim();
00578       Int_t jplane = iplane;
00579       if(jplane>249)jplane+=20;
00580             
00581       if(kView==PlaneView::kU){
00582         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00583           deltaStrip = (istrip - mU*jplane-cU);
00584           if(deltaStrip>2.0)onTrack=false;
00585         }
00586       }
00587       if(kView==PlaneView::kV){
00588         if(iplane>=lowestUplane-1&&iplane<=highestUplane+1){
00589           deltaStrip = (istrip - mV*jplane-cV);
00590           if(deltaStrip>2.0)onTrack=false;
00591         }
00592       }
00593       if(onTrack){
00594         Float_t wlsE = pCalculator->GetWlsE();
00595         Float_t wlsW = pCalculator->GetWlsW();
00596         Float_t clearE = pCalculator->GetClearE();
00597         Float_t clearW = pCalculator->GetClearW();
00598         pCalculator->CalcDt();
00599         Float_t dt   = pCalculator->DT();
00600         Double_t tE  = pCalculator->GetTE();
00601         Double_t tW  = pCalculator->GetTW();
00602 
00603         //      cout << "MOD : " << iplane << " : " << tE << " : " << tW << endl;
00604         //      cout << "MOD : " << clearE << "," << clearW << ":" <<  (clearW-clearE)/fWLSFibreC << endl;
00605 
00606         Float_t target;
00607         //      Float_t mydt = (tW-tE)-(clearW-clearE)/fClearFibreC-(wlsW-wlsE)/fWLSFibreC;
00608         //      cout << dt << ":" << ":" << mydt << endl;
00609 
00610         if(kView==PlaneView::kU)target = mV*jplane+cV;
00611         if(kView==PlaneView::kV)target = mU*jplane+cU;
00612         Float_t yclear = 2.0*fScintillatorN*(target-96.0)*0.04166-
00613           0.3*(tW-tE) + fWLSFibreN*(wlsW-wlsE);
00614         Float_t dtclear = (tW-tE) - (wlsW-wlsE)/fWLSFibreC - 
00615           2.0*(target-96.0)*0.04166/fScintillatorC
00616           - (clearW-clearE)/fClearFibreC;
00617         Float_t ywls = 2.0*fScintillatorN*(target-96.0)*0.04166-
00618           0.3*(tW-tE) + fClearFibreN*(clearW-clearE);
00619 
00620         Float_t dtwls;
00621         if(kView==PlaneView::kU){
00622           dtwls= (tW-tE) - (clearW-clearE)/fClearFibreC - 
00623             2.0*(target-96.0)*0.04166/fScintillatorC
00624             - (wlsW-wlsE)/fWLSFibreC;
00625         }else{
00626           dtwls= (tW-tE) - (clearW-clearE)/fClearFibreC + 
00627             2.0*(target-96.0)*0.04166/fScintillatorC
00628             - (wlsW-wlsE)/fWLSFibreC;
00629         }
00630 
00631 
00632         if(kView==PlaneView::kU){
00633           fDStripVsPlaneU->Fill(iplane,isaim-target,1.);
00634           fUdt->Fill(target,dt,1.);
00635           fUsdt->Fill(target-isaim,1.);
00636           fUsdtc->Fill(target-isaim,1.);
00637 
00638           if(iplane>250)fUsdtH->Fill(target-isaim,1.);
00639           fUclearNdt->Fill(clearW-clearE,yclear,1.);
00640           fUcleardt->Fill(clearW-clearE,dtclear,1.);
00641           fUwlsNdt->Fill(wlsW-wlsE,ywls,1.);
00642           fUwlsdt->Fill(wlsW-wlsE,dtwls,1.);
00643         }
00644         if(kView==PlaneView::kV){
00645           fVsdt->Fill(target-isaim,1.);
00646           if(iplane>250)fVsdtH->Fill(target-isaim,1.);
00647           fDStripVsPlaneV->Fill(iplane,isaim-target,1.);
00648           fVdt->Fill(target,dt,1.);
00649           fVclearNdt->Fill(clearW-clearE,yclear,1.);
00650           fVcleardt->Fill(clearW-clearE,dtclear,1.);
00651           fVwlsNdt->Fill(wlsW-wlsE,ywls,1.);
00652           fVwlsdt->Fill(wlsW-wlsE,dtwls,1.);
00653         }
00654       }
00655     }
00656   }
00657 
00658   return true;
00659 
00660 }


Member Data Documentation

AltDeMuxDisplay* AltDeMuxModule::fAltDeMuxDisplay [private]
 

Definition at line 67 of file AltDeMuxModule.h.

TCanvas* AltDeMuxModule::fCanvasAltDeMux [private]
 

Definition at line 64 of file AltDeMuxModule.h.

Float_t AltDeMuxModule::fClearFibreC [private]
 

Definition at line 75 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

Float_t AltDeMuxModule::fClearFibreN [private]
 

Definition at line 78 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

const Char_t* AltDeMuxModule::fDeMuxAlg [private]
 

Definition at line 61 of file AltDeMuxModule.h.

Referenced by Config(), and Reco().

std::vector<DeMuxedPair> AltDeMuxModule::fDeMuxedPairs [private]
 

Definition at line 69 of file AltDeMuxModule.h.

Referenced by Ana(), and SelectCleanMuons().

bool AltDeMuxModule::fDiagnosticPlots [private]
 

Definition at line 60 of file AltDeMuxModule.h.

Int_t AltDeMuxModule::fDraw [private]
 

Definition at line 59 of file AltDeMuxModule.h.

Referenced by Config().

TH2F* AltDeMuxModule::fDStripVsPlaneU [private]
 

Definition at line 119 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fDStripVsPlaneV [private]
 

Definition at line 120 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

const Char_t* AltDeMuxModule::fHistoFileName [private]
 

Definition at line 62 of file AltDeMuxModule.h.

Int_t AltDeMuxModule::fNumberOfStrips [private]
 

Definition at line 81 of file AltDeMuxModule.h.

std::vector<PlexSEIdAltL*> AltDeMuxModule::fPlanesAltLists[MAX_NUMBER_OF_PLANES][2] [private]
 

Definition at line 68 of file AltDeMuxModule.h.

Referenced by Ana(), and GetFibreLengths().

TH2F* AltDeMuxModule::fQ1Q2All [private]
 

Definition at line 118 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fQ1Q2Good [private]
 

Definition at line 117 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

Float_t AltDeMuxModule::fScintillatorC [private]
 

Definition at line 77 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

Float_t AltDeMuxModule::fScintillatorN [private]
 

Definition at line 80 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TH2F* AltDeMuxModule::fUcleardt [private]
 

Definition at line 106 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fUclearNdt [private]
 

Definition at line 110 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fUdt [private]
 

Definition at line 104 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH1F* AltDeMuxModule::fUG [private]
 

Definition at line 83 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fUQdl [private]
 

Definition at line 114 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fUrat [private]
 

Definition at line 102 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fUsdq [private]
 

Definition at line 89 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fUsdq1 [private]
 

Definition at line 94 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fUsdq2 [private]
 

Definition at line 96 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fUsdq3 [private]
 

Definition at line 98 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fUsdt [private]
 

Definition at line 85 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH1F* AltDeMuxModule::fUsdtc [private]
 

Definition at line 101 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH1F* AltDeMuxModule::fUsdtH [private]
 

Definition at line 87 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fUviewAltDeMux [private]
 

Definition at line 65 of file AltDeMuxModule.h.

TH2F* AltDeMuxModule::fUwlsdt [private]
 

Definition at line 108 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fUwlsNdt [private]
 

Definition at line 112 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TPolyLine* AltDeMuxModule::fUZFitSSM1 [private]
 

Definition at line 124 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fUZFitSSM2 [private]
 

Definition at line 129 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fUZFitTSM1 [private]
 

Definition at line 122 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fUZFitTSM2 [private]
 

Definition at line 127 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TH2F* AltDeMuxModule::fVcleardt [private]
 

Definition at line 107 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fVclearNdt [private]
 

Definition at line 111 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fVdt [private]
 

Definition at line 105 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH1F* AltDeMuxModule::fVG [private]
 

Definition at line 84 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fVQdl [private]
 

Definition at line 115 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fVrat [private]
 

Definition at line 103 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdq [private]
 

Definition at line 90 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdq1 [private]
 

Definition at line 95 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdq2 [private]
 

Definition at line 97 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdq3 [private]
 

Definition at line 99 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fVsdqQ [private]
 

Definition at line 91 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH2F* AltDeMuxModule::fVsdqV [private]
 

Definition at line 92 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdt [private]
 

Definition at line 86 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH1F* AltDeMuxModule::fVsdtc [private]
 

Definition at line 100 of file AltDeMuxModule.h.

Referenced by BookHistos(), and EndJob().

TH1F* AltDeMuxModule::fVsdtH [private]
 

Definition at line 88 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fVviewAltDeMux [private]
 

Definition at line 66 of file AltDeMuxModule.h.

TH2F* AltDeMuxModule::fVwlsdt [private]
 

Definition at line 109 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TH2F* AltDeMuxModule::fVwlsNdt [private]
 

Definition at line 113 of file AltDeMuxModule.h.

Referenced by BookHistos(), EndJob(), and SelectCleanMuons().

TPolyLine* AltDeMuxModule::fVZFitSSM1 [private]
 

Definition at line 125 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fVZFitSSM2 [private]
 

Definition at line 130 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fVZFitTSM1 [private]
 

Definition at line 123 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

TPolyLine* AltDeMuxModule::fVZFitTSM2 [private]
 

Definition at line 128 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

Float_t AltDeMuxModule::fWLSFibreC [private]
 

Definition at line 76 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

Float_t AltDeMuxModule::fWLSFibreN [private]
 

Definition at line 79 of file AltDeMuxModule.h.

Referenced by SelectCleanMuons().

AltDeMuxCalc* AltDeMuxModule::pCalculator [private]
 

Definition at line 70 of file AltDeMuxModule.h.

Referenced by Ana(), GetFibreLengths(), and SelectCleanMuons().

UgliGeomHandle* AltDeMuxModule::pUgh [private]
 

Definition at line 72 of file AltDeMuxModule.h.

Referenced by Ana(), and GetFibreLengths().


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 15:55:33 2007 for loon by  doxygen 1.3.9.1