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

BMSpillAna Class Reference
[BeamDataUtil]

Beam quality cuts and other method to analyze beam data ntuples. More...

#include <BMSpillAna.h>

List of all members.

Public Member Functions

 BMSpillAna ()
virtual ~BMSpillAna ()
const RegistryDefaultConfig () const
void Config (const Registry &r)
const RegistryGetUserCuts () const
 Access the cuts supplied by the user.
void UseDatabaseCuts (Bool_t usedb=true)
 Change if one wants to use the database or not.
void UseCutsSet (Dbi::Task cutset)
 Change the set of cuts to use.
void SetSpill (const BeamMonSpill &spill)
 Set the BeamMonSpill object.
void SetSpill (const NtpBDLiteRecord &ntpbdr, BeamMonSpill &spill)
void SetSnarlTime (const VldTimeStamp &vs_snarl)
void SetTimeDiff (Double_t tdiff)
const BeamMonSpillGetSpill () const
 Return a reference to BeamMonSpill object.
Bool_t SelectSpill ()
 Select a spill within the cut values.
Double_t FractionOnTarget ()
Double_t CalcFracOnTarget (Double_t bpos, Double_t bwid, Double_t tedg, Double_t toff)
void Print ()
 Print out the cut values.

Private Member Functions

void ChangeCutValues (const Registry &r)
 Apply changes to the cut values.
void ApplyUserCuts ()

Private Attributes

const BeamMonSpillfSpill
 The pointer to the reference to the BeamMonSpill object.
Registry fUserCuts
Bool_t fUseDBCuts
Dbi::Task fCutsSet
DbiResultPtr< BeamMonCutsfResPtr
Int_t fResID
Double_t fTimeDiff
Double_t fTimeDiffMax
 Below here are all the members that hold the cut values.
Double_t fPosTgtXMin
Double_t fPosTgtXMax
Double_t fPosTgtYMin
 Defaults are min=0.01 and max=2.0.
Double_t fPosTgtYMax
Double_t fWidXMin
Double_t fWidXMax
Double_t fWidYMin
 Defaults are min=0.1 and max=2.0.
Double_t fWidYMax
Int_t fUseSpotSizeCut
Int_t fUseProfMonOut
Double_t fTorIntMin
Double_t fTorIntMax
Double_t fHornCurMin
Double_t fHornCurMax
Int_t fTargetIn
Int_t fBeamType
Double_t fFracOnTargetMin
Double_t fFracOnTargetMax


Detailed Description

Beam quality cuts and other method to analyze beam data ntuples.

A helper class with a number of useful methods, like beam quality cuts, to handle BeamMonSpill or NtpBDLite objects. Behind the scenes, this class uses BeamMonSpill objects, and transforms NtpBDLiteRecord objects accordingly. In this way, one can maintain only one version of the code and also access useful methods in BeamMonSpill.

The default values for the cuts on the beam quantities are not very strict. So don't use them blindly, have a look at them and determine if they satisfy your needs. There is also no cut on the timing difference between the snarl and the spill.

As of February 22, 2007, the default is to use the cut values that are in the database table BEAMMONCUTS. It is possible to switch back and use hardcoded values through the fUseDBCuts switch.

Author:
(last to touch it)
Author
mdier
Version:
Revision
1.12
Date:
Date
2007/02/22 16:22:54
Contact: mdier@bnl.gov

Created on: Fri Aug 26 16:29:30 2005

Id
BMSpillAna.h,v 1.12 2007/02/22 16:22:54 mdier Exp

Definition at line 49 of file BMSpillAna.h.


Constructor & Destructor Documentation

BMSpillAna::BMSpillAna  ) 
 

Definition at line 16 of file BMSpillAna.cxx.

References ChangeCutValues().

00017     :fSpill(0),fUserCuts(),fUseDBCuts(true),fCutsSet(0),fResPtr(),
00018      fResID(-1),fTimeDiff(-99999)
00019 {
00020     this->ChangeCutValues(this->DefaultConfig());
00021 }

BMSpillAna::~BMSpillAna  )  [virtual]
 

Definition at line 24 of file BMSpillAna.cxx.

00025 {}


Member Function Documentation

void BMSpillAna::ApplyUserCuts  )  [private]
 

Definition at line 109 of file BMSpillAna.cxx.

References ChangeCutValues(), and fUserCuts.

Referenced by SelectSpill().

00110 {
00111     this->ChangeCutValues(fUserCuts);
00112 }

Double_t BMSpillAna::CalcFracOnTarget Double_t  bpos,
Double_t  bwid,
Double_t  tedg,
Double_t  toff
 

Calculates the fraction of the integral of a gaussian with mean bpos and width bwid between -tpos-toff and +tpos-toff

Definition at line 342 of file BMSpillAna.cxx.

Referenced by FractionOnTarget().

00343 {
00344     Double_t powl = tedg+bpos-toff;
00345     powl /= bwid;
00346     powl /= TMath::Sqrt(2.0);
00347     Double_t powu = tedg-bpos+toff;
00348     powu /= bwid;
00349     powu /= TMath::Sqrt(2.0);
00350     Double_t frac = TMath::Erf(powl)/2 +  TMath::Erf(powu)/2; 
00351     return frac;
00352 }

void BMSpillAna::ChangeCutValues const Registry r  )  [private]
 

Apply changes to the cut values.

Definition at line 74 of file BMSpillAna.cxx.

References fBeamType, fFracOnTargetMax, fFracOnTargetMin, fHornCurMax, fHornCurMin, fPosTgtXMax, fPosTgtXMin, fPosTgtYMax, fPosTgtYMin, fTargetIn, fTimeDiffMax, fTorIntMax, fTorIntMin, fUseProfMonOut, fUseSpotSizeCut, fWidXMax, fWidXMin, fWidYMax, fWidYMin, Registry::Get(), and Registry::Size().

Referenced by ApplyUserCuts(), BMSpillAna(), Config(), and SelectSpill().

00075 {
00076     if (r.Size()>0){
00077         r.Get("TimeDiffMax",fTimeDiffMax);
00078         
00079         r.Get("PosTgtXMin",fPosTgtXMin);
00080         r.Get("PosTgtXMax",fPosTgtXMax);
00081         
00082         r.Get("PosTgtYMin",fPosTgtYMin);
00083         r.Get("PosTgtYMax",fPosTgtYMax);
00084         
00085         r.Get("WidXMin",fWidXMin);
00086         r.Get("WidXMax",fWidXMax);
00087         
00088         r.Get("WidYMin",fWidYMin);
00089         r.Get("WidYMax",fWidYMax);
00090 
00091         r.Get("UseSpotSizeCut",fUseSpotSizeCut);
00092         
00093         r.Get("UseProfMonOut",fUseProfMonOut);
00094         
00095         r.Get("TorIntMin",fTorIntMin);
00096         r.Get("TorIntMax",fTorIntMax);
00097         
00098         r.Get("HornCurMin",fHornCurMin);
00099         r.Get("HornCurMax",fHornCurMax);
00100         
00101         r.Get("TargetIn",fTargetIn);
00102         r.Get("BeamType",fBeamType);
00103         
00104         r.Get("FracOnTargetMin",fFracOnTargetMin);
00105         r.Get("FracOnTargetMax",fFracOnTargetMax);
00106     }        
00107 }

void BMSpillAna::Config const Registry r  ) 
 

Definition at line 68 of file BMSpillAna.cxx.

References ChangeCutValues(), and fUserCuts.

Referenced by NueBeamMonModule::Config(), MeuCuts::GetBDSelectSpillInfo(), NuBeam::IsGoodSpillAndFillPot(), NtpTools::PassBeamCuts(), and StndBmsSpin::Scan().

00069 {
00070     fUserCuts=r;
00071     this->ChangeCutValues(r);
00072 }

const Registry & BMSpillAna::DefaultConfig  )  const
 

Definition at line 28 of file BMSpillAna.cxx.

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

00029 {
00030     static Registry r;
00031     if (r.Size() == 0) {
00032         r.UnLockValues();
00033         r.Set("TimeDiffMax", 1.0*Munits::s);
00034 
00035         r.Set("PosTgtXMin",-2.0*Munits::mm);
00036         r.Set("PosTgtXMax",-0.01*Munits::mm);
00037 
00038         r.Set("PosTgtYMin",0.01*Munits::mm);
00039         r.Set("PosTgtYMax",2.0*Munits::mm);
00040 
00041         r.Set("WidXMin",0.1*Munits::mm);
00042         r.Set("WidXMax",1.5*Munits::mm);
00043 
00044         r.Set("WidYMin",0.1*Munits::mm);
00045         r.Set("WidYMax",2.0*Munits::mm);
00046 
00047         r.Set("UseSpotSizeCut",0);
00048         
00049         r.Set("UseProfMonOut",1);
00050 
00051         r.Set("TorIntMin",0.50);
00052         r.Set("TorIntMax",50.0);
00053 
00054         r.Set("HornCurMin",-2.0e5*Munits::ampere);
00055         r.Set("HornCurMax",-1.55e5*Munits::ampere);
00056 
00057         r.Set("TargetIn",1);
00058         r.Set("BeamType",-1);
00059 
00060         r.Set("FracOnTargetMin",0.0);
00061         r.Set("FracOnTargetMax",1.0);
00062 
00063         r.LockValues();
00064     }
00065     return r;
00066 }

Double_t BMSpillAna::FractionOnTarget  ) 
 

Calcualte the fraction of beam on target using the BPM position at the target and the beam with from the profile monitors. It is actually the product of the fraction in the horizontal and vertical direction. For the latter, the part of the target that is hidden behind the baffle is not taken as part of the target (i.e. assume a target of +-5.5mm in vertical and +-3.2mm in horizontal, values from sections 4.2.2 and 4.2.3 of the NuMI Technical Design Handbook)

note **** This method can only be used when the widths assume a gaussian distribution (e.g. obtained from fitting to the profile monitors). At the moment, only the rms of the beam profiles are in the database and the result from this method has no meaning.

Definition at line 306 of file BMSpillAna.cxx.

References BeamMonSpill::BpmAtTarget(), CalcFracOnTarget(), BeamMonSpill::fProfWidX, BeamMonSpill::fProfWidY, and fSpill.

Referenced by SelectSpill().

00307 {
00308     Double_t frac = -1;
00309 //
00310     Double_t bposx = 0;
00311     Double_t bwidx = 0;
00312 //
00313     Double_t bposy = 0;
00314     Double_t bwidy = 0;
00315     
00316     // Get the position at target 
00317     fSpill->BpmAtTarget(bposx,bposy,bwidx,bwidy);
00318     
00319     // Set the values of the widths to prof mon fits
00320     bwidx = fSpill->fProfWidX; 
00321     bwidy = fSpill->fProfWidY; 
00322 
00323     // information of profile monitors not available or fits failed
00324     if (bwidx<=0 || bwidy<=0) return frac;
00325 
00326     // large values also indicate fit failure
00327     if (bwidx>5*Munits::mm || bwidy>05*Munits::mm) return frac;
00328 
00329 // Set the target center and edges in BPM coordinates in x and y
00330     Double_t tedgx = 3.2*Munits::mm;
00331     Double_t toffx = -1.2*Munits::mm;
00332     Double_t tedgy = 5.5*Munits::mm;
00333     Double_t toffy = 0.9*Munits::mm;
00334 
00335 
00336     frac = CalcFracOnTarget(bposx,bwidx,tedgx,toffx);
00337     frac *= CalcFracOnTarget(bposy,bwidy,tedgy,toffy);
00338     
00339     return frac;    
00340 }

const BeamMonSpill & BMSpillAna::GetSpill  )  const [inline]
 

Return a reference to BeamMonSpill object.

Definition at line 276 of file BMSpillAna.h.

Referenced by NuBeam::IsGoodSpillAndFillPot().

00277 {return *fSpill;}

const Registry & BMSpillAna::GetUserCuts  )  const [inline]
 

Access the cuts supplied by the user.

Definition at line 273 of file BMSpillAna.h.

00274 {return fUserCuts;}

void BMSpillAna::Print  ) 
 

Print out the cut values.

Definition at line 354 of file BMSpillAna.cxx.

References fBeamType, fFracOnTargetMax, fFracOnTargetMin, fHornCurMax, fHornCurMin, fPosTgtXMax, fPosTgtXMin, fPosTgtYMax, fPosTgtYMin, fTargetIn, fTimeDiffMax, fTorIntMax, fTorIntMin, fUseProfMonOut, fWidXMax, fWidXMin, fWidYMax, and fWidYMin.

Referenced by NuAnalysis::ExtractConfig(), NuBeam::IsGoodSpillAndFillPot(), and SelectSpill().

00355 {
00356     cout << endl << "Beam Monitoring Cut Values:" << endl;
00357     cout         << "===========================" << endl;
00358 
00359     printf(" > Maximum time diffrence (s):         %5.3f\n",fTimeDiffMax);
00360     printf(" > Spill intensity (1e12 pot):     [%5.2f,%5.2f]\n",
00361            fTorIntMin, fTorIntMax);
00362     printf(" > Horn Current (kA):             [%+5.1f,%+5.1f]\n",
00363            fHornCurMin/Munits::ampere/1e3, fHornCurMax/Munits::ampere/1e3);
00364     printf(" > Target in/out:                      %3d\n",fTargetIn);
00365     printf(" > fBeamType:                          %3d\n",fBeamType);    
00366     printf(" > Horizontal beam position (mm): [%+5.3f,%+5.3f]\n",
00367            fPosTgtXMin/Munits::mm, fPosTgtXMax/Munits::mm);
00368     printf(" > Vertical beam position (mm):   [%+5.3f,%+5.3f]\n",
00369            fPosTgtYMin/Munits::mm, fPosTgtYMax/Munits::mm);
00370     printf(" > Horizontal beam width a (mm):  [%+5.3f,%+5.3f]\n",
00371            fWidXMin/Munits::mm, fWidXMax/Munits::mm);
00372     printf(" > Vertical beam width a (mm):    [%+5.3f,%+5.3f]\n",
00373            fWidYMin/Munits::mm, fWidYMax/Munits::mm);
00374     printf(" > Use spill when prof mon out:        %3d\n",fUseProfMonOut);
00375     printf(" > Beam fraction on target:       [%5.3f,%5.3f]\n",
00376            fFracOnTargetMin, fFracOnTargetMax);
00377 
00378 }

Bool_t BMSpillAna::SelectSpill  ) 
 

Select a spill within the cut values.

Definition at line 163 of file BMSpillAna.cxx.

References ApplyUserCuts(), BeamMonSpill::BeamType(), BeamMonSpill::BpmAtTarget(), ChangeCutValues(), fBeamType, fCutsSet, fFracOnTargetMax, fFracOnTargetMin, BeamMonSpill::fHornCur, fHornCurMin, BeamMonCuts::FillRegistry(), BeamMonSpill::fProfWidX, BeamMonSpill::fProfWidY, FractionOnTarget(), fResID, fResPtr, fSpill, fTimeDiff, fTorIntMin, BeamMonSpill::fTrtgtd, fWidXMax, fWidXMin, fWidYMin, MsgStream::GetLogLevel(), DbiResultPtr< T >::GetResultID(), DbiResultPtr< T >::GetRow(), BeamMonSpill::GetStatusBits(), MsgService::GetStream(), MsgService::Instance(), MAXMSG, MSG, DbiResultPtr< T >::NewQuery(), Print(), and BeamMonSpill::SpillTime().

Referenced by ParticleBeamMonAna::ana(), MadTVAnalysis::CreatePAN(), MadPIDAnalysis::CreatePAN(), MadMKAnalysis::CreatePAN(), MadAnalysis::CreatePAN(), NuExtraction::ExtractBeamInfoDB(), NuAnalysis::ExtractConfig(), ANtpInfoObjectFillerBeam::FillBeamInformation(), NtpMaker::FillSpillInfo(), MeuCuts::GetBDSelectSpillInfo(), NuBeam::IsGoodSpillAndFillPot(), NtpTools::PassBeamCuts(), DataQualityInterface::ProcessBeamStatus(), NueBeamMonModule::Reco(), and StndBmsSpin::Scan().

00164 {
00165     if (fTimeDiff==-99999)
00166         MSG("BMSpillAna", Msg::kWarning) <<
00167             "Time difference seems not to be set correctly" << endl;
00168     
00169     
00170     // If using the database, check whether the cuts need to be
00171     // updated
00172         
00173     if (fUseDBCuts){
00174         MAXMSG("BMSpillAna", Msg::kDebug,5) <<
00175             "Using database cuts" << endl;
00176 
00177 
00178         VldContext vc(Detector::kNear,SimFlag::kData,fSpill->SpillTime());
00179         Int_t nrows = fResPtr.NewQuery(vc,fCutsSet);
00180         if (nrows==0){
00181             MAXMSG("BMSpillAna",Msg::kWarning,20)
00182                 << "No cuts found in database. This should not happen!"
00183                 << endl;
00184         }
00185         else {
00186             if (nrows>1) {
00187                 MAXMSG("BMSpillAna",Msg::kWarning,20)
00188                     << "More than one row found for VldContext " 
00189                     << vc << endl;
00190                 MAXMSG("BMSpillAna",Msg::kWarning,20)
00191                     << "   --> Will only use first row! " << endl;
00192             }
00193             
00194             MAXMSG("BMSpillAna", Msg::kDebug,5) <<
00195                 "Rows found in BEAMMONCUTS table" << endl;
00196             // If the cuts are still the same (i.e. the data in the
00197             // DbiResultPointer is the same, do nothing, just keep the
00198             // current cut values, else change the cut values and
00199             // apply user cuts
00200 
00201             Int_t newid = fResPtr.GetResultID();
00202             if (newid != fResID){
00203                 MSG("BMSpillAna", Msg::kDebug) <<
00204                     "Cuts need to be updated for spill at " << fSpill->SpillTime()  << endl;
00205                 fResID = newid;
00206                 const BeamMonCuts* bmc = fResPtr.GetRow(0);
00207                 Registry newreg;
00208                 bmc->FillRegistry(&newreg);
00209                 this->ChangeCutValues(newreg);
00210 
00211                 Int_t loglevel = MsgService::Instance()->GetStream("BMSpillAna")->GetLogLevel();
00212                 if (loglevel == Msg::kDebug){
00213                     cout << "Database cuts" << endl;
00214                     this->Print();
00215                 }
00216 
00217                 this->ApplyUserCuts();
00218                 if (loglevel == Msg::kDebug){
00219                     cout << "After user cuts" << endl;
00220                     this->Print();
00221                 }
00222             }
00223         }        
00224     }
00225 
00226     if (fabs(fTimeDiff)>fTimeDiffMax) return false;
00227     
00228     Double_t xmean=0;
00229     Double_t ymean=0;
00230     Double_t xrms=0;
00231     Double_t yrms=0;
00232     fSpill->BpmAtTarget(xmean,ymean,xrms,yrms);
00233     if (xmean < fPosTgtXMin || xmean > fPosTgtXMax) return false;
00234     if (ymean < fPosTgtYMin || ymean > fPosTgtYMax) return false;
00235 
00236 
00237     // Never select fit failures
00238     if (fSpill->fProfWidX < -0.1*Munits::mm
00239         || fSpill->fProfWidY < -0.1*Munits::mm) return false;
00240     //
00241     if (fUseSpotSizeCut){
00242         // The widths should never be negative, unless it's due to a
00243         // fit failure, but these are already excluded above. The
00244         // values will be zero if the profile monitor is out.
00245         Double_t spot_size=0;
00246         if (fSpill->fProfWidX>0 && fSpill->fProfWidY>0)
00247             spot_size = fSpill->fProfWidX*fSpill->fProfWidY;
00248 
00249         // put this defualt to a small negative value, so that the
00250         // pribility exists to select the spill if the profile monitor
00251         // is out, i.e. widths are zero.
00252         Double_t spot_size_min = -0.01*Munits::mm*Munits::mm;
00253         if (fWidXMin>0 && fWidYMin>0)
00254             spot_size_min = fWidXMin*fWidYMin;
00255 
00256         // Assume people are smart enough not to put negative values
00257         // for the upper limit on the beam widths. If they do, they
00258         // will loose all spills...
00259         Double_t spot_size_max = fWidXMax*fWidYMax;
00260 
00261         if (!(fUseProfMonOut) && spot_size < spot_size_min ) return false;
00262         else if (spot_size > spot_size_max) return false;
00263 
00264     }
00265     else {       
00266         if (!(fUseProfMonOut) && fSpill->fProfWidX < fWidXMin) return false;
00267         else if (fSpill->fProfWidX > fWidXMax) return false;
00268         
00269         if (!(fUseProfMonOut) && fSpill->fProfWidY < fWidYMin) return false;
00270         else if (fSpill->fProfWidY > fWidYMax) return false;
00271     }
00272 
00273 
00274     //changed to Trtgtd from Tortgt on 20080814
00275     if (fSpill->fTrtgtd < fTorIntMin || fSpill->fTrtgtd > fTorIntMax){
00276         return false;
00277     }
00278     
00279     // FIXME: values in the database are in kAmps, not in
00280     // Munits. This will get fixed eventually, but for now, there
00281     // need to be an explicit factor of 1e3.
00282     if (fSpill->fHornCur*1e3 < fHornCurMin || fSpill->fHornCur*1e3 > fHornCurMax){
00283         return false;
00284     }
00285 
00286     //added  fTargetIn < 0 || on 20080814
00287     if ( fTargetIn < 0 || (fTargetIn >= 0 && (Bool_t)fSpill->GetStatusBits().target_in != (Bool_t)fTargetIn) ){ 
00288         return false;
00289     }
00290 
00291     if (fBeamType >=0 && (fSpill->BeamType() != fBeamType)){
00292         return false;
00293     }
00294 
00295     if (fFracOnTargetMin > 0 &&  this->FractionOnTarget() < fFracOnTargetMin) {
00296         return false;
00297     }
00298     if (fFracOnTargetMax < 1 &&  this->FractionOnTarget() > fFracOnTargetMax) {
00299         return false;
00300     }
00301     
00302     return true;
00303 }

void BMSpillAna::SetSnarlTime const VldTimeStamp vs_snarl  ) 
 

Give the snarl trigger time, to calculate the time difference wrt the beam monitoring data. This can be used alternative to SetTimeDiff below. This need to be called when using BeamMonSpill objects (i.e. no BDLite ntuples). Be aware that you will need to call this method AFTER you set the spill object, and this needs to be set.

Definition at line 154 of file BMSpillAna.cxx.

References fSpill, MSG, SetTimeDiff(), and BeamMonSpill::SpillTime().

Referenced by ParticleBeamMonAna::ana(), MadPIDAnalysis::CreatePAN(), and NueBeamMonModule::Reco().

00155 {
00156     if (fSpill==0){
00157         MSG("BMSpillAna", Msg::kError)<< "Set the spill object before setting this time" << endl;
00158         return;
00159     }
00160     this->SetTimeDiff(vs_snarl-fSpill->SpillTime());
00161 }

void BMSpillAna::SetSpill const NtpBDLiteRecord ntpbdr,
BeamMonSpill spill
 

Set the NtpBDLiteRecord object. The user should create and pass in a non const BeamMonSpill object by him/herself. This is to facilitate memory management.

Definition at line 124 of file BMSpillAna.cxx.

References NtpBDLiteRecord::bpmint, NtpBDLiteRecord::bposx, NtpBDLiteRecord::bposy, NtpBDLiteRecord::bwidx, NtpBDLiteRecord::bwidy, BeamMonSpill::fBpmInt, BeamMonSpill::fDaeTime, BeamMonSpill::fHadInt, BeamMonSpill::fHornCur, BeamMonSpill::fMuInt1, BeamMonSpill::fMuInt2, BeamMonSpill::fMuInt3, BeamMonSpill::fProfWidX, BeamMonSpill::fProfWidY, fSpill, BeamMonSpill::fTargBpmX, BeamMonSpill::fTargBpmY, BeamMonSpill::fTor101, BeamMonSpill::fTortgt, BeamMonSpill::fTr101d, BeamMonSpill::fTrtgtd, BeamMonSpill::fVmeTime, BeamDataLiteHeader::GetEarliestTimeStamp(), RecRecordImp< T >::GetHeader(), BeamDataLiteHeader::GetStatus(), BeamDataLiteHeader::GetTimeDiffStreamSpill(), NtpBDLiteRecord::hadint, NtpBDLiteRecord::horncur, NtpBDLiteRecord::muint1, NtpBDLiteRecord::muint2, NtpBDLiteRecord::muint3, BeamMonSpill::SetStatusBits(), SetTimeDiff(), NtpBDLiteRecord::tor101, NtpBDLiteRecord::tortgt, NtpBDLiteRecord::tr101d, and NtpBDLiteRecord::trtgtd.

00125 {
00126     fSpill = &spill;
00127 
00128     this->SetTimeDiff(ntpbdr.GetHeader().GetTimeDiffStreamSpill());
00129     
00130     spill.fDaeTime = ntpbdr.GetHeader().GetEarliestTimeStamp();
00131     spill.fVmeTime = ntpbdr.GetHeader().GetEarliestTimeStamp();
00132     spill.fTor101  = ntpbdr.tor101;
00133     spill.fTr101d  = ntpbdr.tr101d;
00134     spill.fTortgt  = ntpbdr.tortgt;
00135     spill.fTrtgtd  = ntpbdr.trtgtd;
00136     spill.fHornCur = ntpbdr.horncur;
00137     for (int i=0;i<6;++i){
00138         spill.fTargBpmX[i] = ntpbdr.bposx[i];
00139         spill.fTargBpmY[i] = ntpbdr.bposy[i];
00140         spill.fBpmInt[i]   = ntpbdr.bpmint[i];
00141     }
00142     spill.fProfWidX = ntpbdr.bwidx;
00143     spill.fProfWidY = ntpbdr.bwidy;
00144     spill.fHadInt = ntpbdr.hadint;
00145     spill.fMuInt1 = ntpbdr.muint1;
00146     spill.fMuInt2 = ntpbdr.muint2;
00147     spill.fMuInt3 = ntpbdr.muint3;
00148     union {int integer; BeamMonSpill::StatusBits bits; } status;
00149     status.integer = ntpbdr.GetHeader().GetStatus();
00150     spill.SetStatusBits(status.bits);
00151 
00152 }

void BMSpillAna::SetSpill const BeamMonSpill spill  ) 
 

Set the BeamMonSpill object.

Definition at line 115 of file BMSpillAna.cxx.

References fSpill, and SetTimeDiff().

Referenced by ParticleBeamMonAna::ana(), MadTVAnalysis::CreatePAN(), MadPIDAnalysis::CreatePAN(), MadMKAnalysis::CreatePAN(), MadAnalysis::CreatePAN(), NuExtraction::ExtractBeamInfoDB(), NuAnalysis::ExtractConfig(), ANtpInfoObjectFillerBeam::FillBeamInformation(), NtpMaker::FillSpillInfo(), MeuCuts::GetBDSelectSpillInfo(), NuBeam::IsGoodSpillAndFillPot(), NtpTools::PassBeamCuts(), DataQualityInterface::ProcessBeamStatus(), NueBeamMonModule::Reco(), and StndBmsSpin::Scan().

00116 {
00117     fSpill = &spill;
00118     // Reset the time difference every time to make sure that the user
00119     // updates it.
00120     this->SetTimeDiff(-99999);
00121 
00122 }

void BMSpillAna::SetTimeDiff Double_t  tdiff  )  [inline]
 

Set the time difference between the data stream and the beam monitoring data, needed when not using the ntuples. Be aware that you will need to call this method AFTER you set the spill object.

Definition at line 279 of file BMSpillAna.h.

References fTimeDiff.

Referenced by MadTVAnalysis::CreatePAN(), MadMKAnalysis::CreatePAN(), MadAnalysis::CreatePAN(), NuExtraction::ExtractBeamInfoDB(), ANtpInfoObjectFillerBeam::FillBeamInformation(), NtpMaker::FillSpillInfo(), DataQualityInterface::ProcessBeamStatus(), StndBmsSpin::Scan(), SetSnarlTime(), and SetSpill().

00280 {fTimeDiff = tdiff;}

void BMSpillAna::UseCutsSet Dbi::Task  cutset  )  [inline]
 

Change the set of cuts to use.

Definition at line 270 of file BMSpillAna.h.

References fCutsSet.

00271 {fCutsSet = cutset;}

void BMSpillAna::UseDatabaseCuts Bool_t  usedb = true  )  [inline]
 

Change if one wants to use the database or not.

Definition at line 267 of file BMSpillAna.h.

References fUseDBCuts.

Referenced by ANtpInfoObjectFillerBeam::ANtpInfoObjectFillerBeam(), MadTVAnalysis::CreatePAN(), MadPIDAnalysis::CreatePAN(), NuExtraction::ExtractBeamInfoDB(), NuAnalysis::ExtractConfig(), NtpMaker::FillSpillInfo(), NuBeam::IsGoodSpillAndFillPot(), NueBeamMonModule::NueBeamMonModule(), and DataQualityInterface::ProcessBeamStatus().

00268 {fUseDBCuts = usedb;}


Member Data Documentation

Int_t BMSpillAna::fBeamType [private]
 

Select specific beam type determined from the position of the target position and horn current. The conventions of Conventions/BeamType.h are followed. Note that the value is stored as an int, so let's hope no one will change the order of the enumeration.... Use the value "-1" to select all target positions. Default is -1

Definition at line 252 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Dbi::Task BMSpillAna::fCutsSet [private]
 

The database can hold different set of cuts used for different purposes. This variables determines which set of cuts to use: 0: Analysis cuts (default) 1-?: Beam study cuts

Definition at line 145 of file BMSpillAna.h.

Referenced by SelectSpill(), and UseCutsSet().

Double_t BMSpillAna::fFracOnTargetMax [private]
 

Definition at line 262 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Double_t BMSpillAna::fFracOnTargetMin [private]
 

Fraction of the beam on target, calculated using BMSpillAna::GetFracOnTarget. The default does not make a selection on this value, i.e. min=0 and max=1 This also makes an assumption of the knowledge of the horizontal and vertical target position. These values might have changed throughout the run.

Definition at line 261 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Double_t BMSpillAna::fHornCurMax [private]
 

Definition at line 236 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fHornCurMin [private]
 

Cuts on the horn current. Units are Munits::ampere Defaults are min=-2.0e5 and max=-1.55e5

Definition at line 235 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Double_t BMSpillAna::fPosTgtXMax [private]
 

Definition at line 172 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fPosTgtXMin [private]
 

Cuts on the beam position at the target projected from the intensity weighted average of all the batch positions measured by the BPMs. Be aware that the target center is not necessarily at (0,0) in this coordinate system. This offset is hard-coded for the time being! Hopefully this can be changed sometime in the future. Units are in Munits::mm. Defaults are min=-2.0 and max=-0.01

Definition at line 171 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fPosTgtYMax [private]
 

Definition at line 175 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fPosTgtYMin [private]
 

Defaults are min=0.01 and max=2.0.

Definition at line 174 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Int_t BMSpillAna::fResID [private]
 

Definition at line 148 of file BMSpillAna.h.

Referenced by SelectSpill().

DbiResultPtr<BeamMonCuts> BMSpillAna::fResPtr [private]
 

Definition at line 147 of file BMSpillAna.h.

Referenced by SelectSpill().

const BeamMonSpill* BMSpillAna::fSpill [private]
 

The pointer to the reference to the BeamMonSpill object.

Definition at line 131 of file BMSpillAna.h.

Referenced by FractionOnTarget(), SelectSpill(), SetSnarlTime(), and SetSpill().

Int_t BMSpillAna::fTargetIn [private]
 

Target in? <0: i don't care =0: target out >0: target in Default is 1

Definition at line 243 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fTimeDiff [private]
 

Time difference between the data stream one is looking at and the beam monitoring time. This will be automatically set when using the beam data ntuples, but has to be set manually when using BeamMonSpill objects. Note that this variable always gets reset after setting the spill when not using the ntuples.

Definition at line 155 of file BMSpillAna.h.

Referenced by SelectSpill(), and SetTimeDiff().

Double_t BMSpillAna::fTimeDiffMax [private]
 

Below here are all the members that hold the cut values.

The maximum absolute time difference allowed. default is 1 second

Definition at line 161 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fTorIntMax [private]
 

Definition at line 230 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fTorIntMin [private]
 

The beam intensity as read out by TORTGT. Units are in 1e12 protons on target Defaults are min=0.5 and max=50

Definition at line 229 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Bool_t BMSpillAna::fUseDBCuts [private]
 

Choose wether to use the database or not, current default is to use the database.

Definition at line 139 of file BMSpillAna.h.

Referenced by UseDatabaseCuts().

Int_t BMSpillAna::fUseProfMonOut [private]
 

Select beam when profile monitors are out. Default is true, one can also use a small negative values for the minimum widths cuts (e.g. -0.1mm)

Definition at line 224 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Registry BMSpillAna::fUserCuts [private]
 

Hold the user defined cut values as a Registry. Will be used to override the default values

Definition at line 135 of file BMSpillAna.h.

Referenced by ApplyUserCuts(), and Config().

Int_t BMSpillAna::fUseSpotSizeCut [private]
 

If this value is non-zero, cut on the spot size instead of individual widths. This is introduced predominantly do deal with the cable swaps of the readout of x and y during the period Summer/Fall 2007. When using the old method of hard coded cuts, the default method will be to cut on the individual widths. In the database, most likely the individual cuts can be maintained for the first year of running, while the cut on beam spot size will be used for data thereafter.

Definition at line 219 of file BMSpillAna.h.

Referenced by ChangeCutValues().

Double_t BMSpillAna::fWidXMax [private]
 

Definition at line 204 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Double_t BMSpillAna::fWidXMin [private]
 

Cuts on the beam widths as measured by the last profile monitor before the target. Be aware that the SWIC devices are not always read out, so there might be perfectly good beam be thrown away Units are in Munits::mm.

For reco version R1.18.0, the rms of the beam profile is in the database. These are in general larger than the widths of a gaussian fit. The default cuts on the rms are determined from the recommended values on the widths above, using data from May 19, 2005 to July 19, 2005. Defaults for rms in x are min=0.1 and max=2.0 Defaults for rms in y are min=0.1 and max=5.0

During the repopulating of the database in November, the widths of the profile monitors where obtained from a Gaussian fit. In the rare case of a fit failure, the database gets filled with -999.

These values will also be used to determine the cut value on the beam spot size. The minimum cut values on the widths in x and y should be set such that S_min=pi*fWidXMin*fWidYMin and likewise for the maximum cut value

Defaults are min=0.1 and max=1.5

Definition at line 203 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().

Double_t BMSpillAna::fWidYMax [private]
 

Definition at line 207 of file BMSpillAna.h.

Referenced by ChangeCutValues(), and Print().

Double_t BMSpillAna::fWidYMin [private]
 

Defaults are min=0.1 and max=2.0.

Definition at line 206 of file BMSpillAna.h.

Referenced by ChangeCutValues(), Print(), and SelectSpill().


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:08:49 2010 for loon by  doxygen 1.3.9.1