/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Attributes | Private Attributes
MuonEffAlg Class Reference

#include <MuonEffAlg.h>

Inheritance diagram for MuonEffAlg:
Inheritance graph
[legend]
Collaboration diagram for MuonEffAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MuonEffAlg (const std::string &name)
virtual ~MuonEffAlg ()
virtual bool initialize ()
virtual bool execute ()
virtual bool finalize ()
const std::string & name ()
SvcBaseservice (const std::string &name)
TOutputSvcntupleSvc ()
bool setOption (const std::string &option, Type &var)

Protected Attributes

std::string m_name

Private Attributes

PhyEventBufm_buffer
TNtuple * m_tuple
double m_search_twd
int m_eBinNum
double m_eStep
double m_energyCut [100]
unsigned int m_adNum [4][100]
unsigned int m_iwsNum [4][100]
unsigned int m_owsNum [4][100]

Detailed Description

Definition at line 8 of file MuonEffAlg.h.


Constructor & Destructor Documentation

MuonEffAlg::MuonEffAlg ( const std::string &  name)

Definition at line 7 of file MuonEffAlg.cc.

  : AlgBase(name)
{
  m_search_twd = 600.; //ns
  m_eBinNum = 4;  // energy bin number
  m_eStep = 100.; // energy step
  for(int i=0;i<GlobalVar::NumADs;i++) {
    for(int j=0;j<m_eBinNum;j++) {
      m_adNum[i][j] = 0;
      m_iwsNum[i][j] = 0;
      m_owsNum[i][j] = 0;
    }
  }
  for(int j=0;j<m_eBinNum;j++) {
    m_energyCut[j] = m_eStep*(j+1);
  }
}
virtual MuonEffAlg::~MuonEffAlg ( ) [inline, virtual]

Definition at line 12 of file MuonEffAlg.h.

{}

Member Function Documentation

bool MuonEffAlg::initialize ( ) [virtual]

Implements AlgBase.

Definition at line 25 of file MuonEffAlg.cc.

{
    m_buffer = dynamic_cast<PhyEventBuf*>(service("Cycler"));
    m_tuple = ntupleSvc()->bookNtuple("FILE1/MuonEff", "MuonEff", "det:energy:x:y:z");
    return true;
}
bool MuonEffAlg::execute ( ) [virtual]

Implements AlgBase.

Definition at line 46 of file MuonEffAlg.cc.

{

  // If bad event, return
  PhyEvent *event = m_buffer->curEvt();
  //if(!event->m_good) return true;
  if(!event->isAD()) return true;

  for(int j=0;j<m_eBinNum;j++) {
    if(event->m_energy > m_energyCut[j]) {  //find a muon
      m_adNum[event->m_det-1][j]++;

      //find IWS and OWS readout in a time window before AD
      PhyEventBuf::Iterator evt = m_buffer->current();
      while ( (--evt) >= m_buffer->begin() ) {
        if((event->m_trigTime-(*evt)->m_trigTime)*1e9 < m_search_twd) {
          if((*evt)->m_det==5) m_iwsNum[event->m_det-1][j]++;
          else if((*evt)->m_det==6) m_owsNum[event->m_det-1][j]++;
        } else {
          break;
        }
      }

      //find IWS and OWS readout in a time window after AD
      evt = m_buffer->current();
      while ( (++evt) < m_buffer->end() ) {
        if(((*evt)->m_trigTime-event->m_trigTime)*1e9 < m_search_twd) {
          if((*evt)->m_det==5) m_iwsNum[event->m_det-1][j]++;
          else if((*evt)->m_det==6) m_owsNum[event->m_det-1][j]++;
        } else {
          break;
        }
      }

    }
  }

  //cout << *event;
  m_tuple->Fill(event->m_det,event->m_energy,event->m_x,event->m_y,event->m_z);

  return true;
}
bool MuonEffAlg::finalize ( ) [virtual]

Implements AlgBase.

Definition at line 32 of file MuonEffAlg.cc.

{
  LogDebug << "---MuonEffAlg::finalize()---" << endl;
  for(int j=0;j<m_eBinNum;j++) {
    LogDebug << "Muon energy cut: " << m_energyCut[j] << endl;
    for(int i=0;i<GlobalVar::NumADs;i++) {
      LogDebug << "AD" << i+1 << " muon event number = " << m_adNum[i][j] << endl;
      LogDebug << "IWS observe number = " << m_iwsNum[i][j] << endl;
      LogDebug << "OWS observe number = " << m_owsNum[i][j] << endl;
    }
  }
  return true;
}

Member Data Documentation

Definition at line 20 of file MuonEffAlg.h.

TNtuple* MuonEffAlg::m_tuple [private]

Definition at line 21 of file MuonEffAlg.h.

double MuonEffAlg::m_search_twd [private]

Definition at line 23 of file MuonEffAlg.h.

int MuonEffAlg::m_eBinNum [private]

Definition at line 24 of file MuonEffAlg.h.

double MuonEffAlg::m_eStep [private]

Definition at line 25 of file MuonEffAlg.h.

double MuonEffAlg::m_energyCut[100] [private]

Definition at line 26 of file MuonEffAlg.h.

unsigned int MuonEffAlg::m_adNum[4][100] [private]

Definition at line 31 of file MuonEffAlg.h.

unsigned int MuonEffAlg::m_iwsNum[4][100] [private]

Definition at line 32 of file MuonEffAlg.h.

unsigned int MuonEffAlg::m_owsNum[4][100] [private]

Definition at line 33 of file MuonEffAlg.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:49 for Algorithms by doxygen 1.7.4