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

In This Package:

Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
SimpRpcRecTool Class Reference

#include <SimpRpcRecTool.h>

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

List of all members.

Public Types

typedef std::vector< int > triggerModuleList
typedef std::vector
< triggerModuleList * > 
clusterTriggerModuleList

Public Member Functions

 SimpRpcRecTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~SimpRpcRecTool ()
virtual StatusCode reconstruct (const DayaBay::CalibReadout &readout, DayaBay::RecRpcTrigger &recRpcTrigger)
virtual StatusCode initialize ()
virtual StatusCode finalize ()
void clustering (triggerModuleList *triggerList, DayaBay::RecRpcTrigger &recRpcTrigger, const CalibReadoutRpcCrate::RpcChannelReadouts &rpcChList, int clusterType)
CalibReadoutRpcCrate::RpcChannelReadouts * getRpcChannelList (int row, int col, const CalibReadoutRpcCrate::RpcChannelReadouts &rpcChList)
CalibReadoutRpcCrate::RpcChannelReadouts * getRpcChannelList (triggerModuleList *triggerList, const CalibReadoutRpcCrate::RpcChannelReadouts &rpcChList)
clusterTriggerModuleListgetClusterList (triggerModuleList *triggerList)
void writeClusterPos (CalibReadoutRpcCrate::RpcChannelReadouts *rpcChList, DayaBay::RecRpcTrigger &recRpcTrigger, int type, int maxLayer, bool is4of4)
void writeTeleScopePosIntoTrk (CalibReadoutRpcCrate::RpcChannelReadouts *rpcChList, DayaBay::RecRpcTrack &recRpcTrk)
int getRpcChannelList (int row, int col, int layer, const CalibReadoutRpcCrate::RpcChannelReadouts &rpcChList)
bool checkHitLayer (triggerModuleList *triggerList, const CalibReadoutRpcCrate::RpcChannelReadouts &rpcChList)
void countHitLayer (triggerModuleList *triggerList, CalibReadoutRpcCrate::RpcChannelReadouts *rpcChList, int &maximum, bool &is4of4)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Attributes

std::string m_cableSvcName
ICableSvcm_cableSvc
std::string m_calibDataSvcName
ICalibDataSvcm_calibDataSvc
std::string m_rpcGeomSvcName
IRpcGeomInfoSvcm_rpcGeomSvc
int numOfTrigModuleInCluster
int numOfClusters
double x_offset [4]
double y_offset [4]
double z_offset [4]
int EH
int numOfRow
int numOfCol
int lessThan3Errs

Detailed Description

Definition at line 29 of file SimpRpcRecTool.h.


Member Typedef Documentation

typedef std::vector<int> SimpRpcRecTool::triggerModuleList

Definition at line 43 of file SimpRpcRecTool.h.

Definition at line 44 of file SimpRpcRecTool.h.


Constructor & Destructor Documentation

SimpRpcRecTool::SimpRpcRecTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 58 of file SimpRpcRecTool.cc.

  : GaudiTool(type,name,parent)
  , m_cableSvc(0)
  , m_calibDataSvc(0)
  , m_rpcGeomSvc(0)
{
    declareInterface< IReconRpcTool >(this) ;   
    declareProperty("CableSvcName",m_cableSvcName="StaticCableSvc",
                    "Name of service to map between detector, hardware, and electronic IDs");
    declareProperty("CalibDataSvcName", m_calibDataSvcName="StaticCalibDataSvc",
                    "Name of calibration data service");
  declareProperty("RpcGeomSvcName", m_rpcGeomSvcName = "RpcGeomInfoSvc",
    "Name of Rpc Geometry Information Service");
  numOfTrigModuleInCluster = 4;
  numOfClusters = 1;
  numOfRow = 6; // Near Site: 6; Far Site:9
  numOfCol = 9; 
  //EH1
  x_offset[1] = 2500.0; 
  y_offset[1] = -500.0;
  z_offset[1] = 12500.0;
  //EH2
  x_offset[2] = 2500.0; 
  y_offset[2] = -500.0;
  z_offset[2] = 12500.0;
  //EH3
  x_offset[3] = 5650.0; 
  y_offset[3] = 500.0;
  z_offset[3] = 12500.0;
  EH = 0;
  lessThan3Errs = 0;
}
SimpRpcRecTool::~SimpRpcRecTool ( ) [virtual]

Definition at line 93 of file SimpRpcRecTool.cc.

{}

Member Function Documentation

StatusCode SimpRpcRecTool::reconstruct ( const DayaBay::CalibReadout readout,
DayaBay::RecRpcTrigger recRpcTrigger 
) [virtual]

Implements IReconRpcTool.

Definition at line 119 of file SimpRpcRecTool.cc.

{
  if( !readout.detector().isRPC() ){
    debug() << "Not an RPC readout; ignoring detector " 
            << readout.detector().detName() << endreq;
    //recRpcTrigger.setEnergyStatus( ReconStatus::kNotProcessed );
    return StatusCode::SUCCESS;
  }
  const ReadoutHeader* readoutHeader = get<ReadoutHeader>("/Event/Readout/ReadoutHeader");
  if ( readoutHeader == 0 ) {
          error() << " Failed to get ReadoutHeader" << endreq;
          return StatusCode::FAILURE;
  }

  const DybDaq::EventReadout* event = &(readoutHeader->daqCrate()->eventReadout());
  const DybDaq::EventHeader* evtHeader = &(event->header());
  EH = evtHeader->site();
  if(EH<1||EH>3)
  {
          error() <<"EH is wrong! EH = " << EH << endreq;
          return StatusCode::FAILURE;
  }
  if(EH==3) numOfRow = 9;
  else      numOfRow = 6;
  const CalibReadoutRpcCrate* rpcReadout 
    = dynamic_cast<const CalibReadoutRpcCrate*>(&readout);
  if(!rpcReadout)
  {
          error() << "Incorrect type of readout crate for detector "
                  << readout.detector().detName() << endreq;
          return StatusCode::FAILURE;
  }

  //Determine the combination type of this event; array only, telescope only or both
  //In the same time, retrieve the list of the  modules which sent out local triggers in this event for clusterring.
  //then, we determine how to reconstruct this event: track, shower or interaction point.
  triggerModuleList* triggerList = new triggerModuleList();
  triggerModuleList* triggerTelList = new triggerModuleList();
  int NoOfTeleRPC = 0;
  int NoOfArrayRPC= 0;
  CalibReadoutRpcCrate::RpcChannelReadouts::const_iterator chanIter;
  for(chanIter=rpcReadout->channelReadout().begin();
                  chanIter != rpcReadout->channelReadout().end();
                  chanIter++)
  {
          const CalibReadoutRpcChannel& channel = *chanIter; 
          const RpcSensor& detSensor = (RpcSensor&)channel.rpcSensorId();
         
          if(!channel.fromRot()) 
                  continue;
          
          int r = detSensor.panelRow();
          int c = detSensor.panelColumn();
          int s = r*10+c;
          if((r==numOfRow+1&&c!=5)||(r==0&&c!=5))
          { 
            error() <<"Invalid (row,col):row = " << r<<"col = "<<c<<"." << endreq;                        
            return StatusCode::FAILURE;
          }
          if((r==numOfRow+1&&c==5)||(r==0&&c==5))//telescope RPCs
          {
           std::vector<int>::iterator it = find(triggerTelList->begin(),triggerTelList->end(),s);
           if(it==triggerTelList->end())
           {
           NoOfTeleRPC++;
           triggerTelList->push_back(s);
           }
          }
          else //array RPCs
          {
           std::vector<int>::iterator it = find(triggerList->begin(),triggerList->end(),s);
           if(it==triggerList->end())
           {
                  NoOfArrayRPC++;
                  triggerList->push_back(s);
           }
          }
   }      

  // if(triggerList->size()>0) std::cout<<"Number Of triggering modules in array ="<<triggerList->size()<<std::endl;
  //  if(triggerTelList->size()>0)std::cout<<"Number Of triggering modules in telescope Rpcs ="<<triggerTelList->size()<<std::endl;
  recRpcTrigger.setTriggerTime(rpcReadout->triggerTime());
 
  
  recRpcTrigger.setDetector(readout.detector());  
  
  if(triggerTelList->size()+triggerList->size()==0) // deal with forced triggers
  {
  delete triggerTelList;
  delete triggerList;
  debug() << "This a forced trigger event (w/o a module sending a trigger)!" << endreq;   
  return StatusCode::SUCCESS;
  }

  //deal with exceptions that no more than 3 layers have hits in any module.
  if(!checkHitLayer(triggerList,rpcReadout->channelReadout())||!checkHitLayer(triggerTelList,rpcReadout->channelReadout()))
  {
   delete triggerTelList;
   delete triggerList;
   return StatusCode::SUCCESS;
  }
  clustering(triggerList,recRpcTrigger,rpcReadout->channelReadout(),1);

  //deal with telescope RPCs and determine if it's a track
 if(triggerTelList->size()==1)
 {
  if(recRpcTrigger.eventType()==1) //track
  {
   RecRpcTrack* rpcTrk = new RecRpcTrack ();

   CalibReadoutRpcCrate::RpcChannelReadouts* selectedRpcChReadouts = getRpcChannelList(triggerTelList,rpcReadout->channelReadout());
   int maxHitsinLayer = 0;
   bool is4of4 = false;
   countHitLayer(triggerTelList,selectedRpcChReadouts, maxHitsinLayer,is4of4);
   writeClusterPos(selectedRpcChReadouts,recRpcTrigger,2,maxHitsinLayer,is4of4);
  rpcTrk->setStart(recRpcTrigger.getCluster(1));
  rpcTrk->setEnd(recRpcTrigger.getCluster(0));
  recRpcTrigger.addTrack(*rpcTrk);
  recRpcTrigger.setEventType(2);
  delete selectedRpcChReadouts;
  delete rpcTrk;
  }
  else if(recRpcTrigger.eventType()==0) // a point on telescope only
  {
    recRpcTrigger.setEventType(1);  // a point
    CalibReadoutRpcCrate::RpcChannelReadouts* selectedRpcChReadouts = getRpcChannelList(triggerTelList,rpcReadout->channelReadout()); 
    int maxHitsinLayer = 0;
    bool is4of4 = false;
    countHitLayer(triggerTelList,selectedRpcChReadouts, maxHitsinLayer,is4of4);
    writeClusterPos(selectedRpcChReadouts,recRpcTrigger,2,maxHitsinLayer,is4of4);
    delete selectedRpcChReadouts;

  }
  else // eventType =3, it's a shower
  {
       recRpcTrigger.setEventType(3);
      CalibReadoutRpcCrate::RpcChannelReadouts* selectedRpcChReadouts = getRpcChannelList(triggerTelList,rpcReadout->channelReadout());
      int maxHitsinLayer = 0;
      bool is4of4 = false;
      countHitLayer(triggerTelList,selectedRpcChReadouts, maxHitsinLayer,is4of4);
      writeClusterPos(selectedRpcChReadouts,recRpcTrigger,2,maxHitsinLayer,is4of4);
      delete selectedRpcChReadouts;
  }
        
 }
 else if (triggerTelList->size()==2)// it's thought as a shower if both of two telescope RPCs have hits
 {
  recRpcTrigger.setEventType(3); 
  clustering(triggerTelList,recRpcTrigger,rpcReadout->channelReadout(),2);
 }
  delete triggerTelList;
  delete triggerList;

 // debug the reconstruction information
  /*std::cout<<"combination type = "<<recRpcTrigger.combinationType()<<std::endl;
   if(recRpcTrigger.eventType()==1) // a point
   {
     std::cout<<"This is  an event of point!"<<std::endl; 
     std::cout<<"(x,y,z) = ("<<recRpcTrigger.getCluster(0)->position().x()<<","<<recRpcTrigger.getCluster(0)->position().y()
             <<","<<recRpcTrigger.getCluster(0)->position().z()<<")"<<std::endl; 
     if(recRpcTrigger.is4of4())std::cout<<"This is 4 ouf 4 event!"<<std::endl;
         std::cout<<"Max num of Hits in a Layer = "<<recRpcTrigger. maxHitsInLayer()<<std::endl;
   }
   else if (recRpcTrigger.eventType()==2) // a track
   {
           std::cout<<"This is  an event of  track!"<<std::endl; 
    std::cout<<"track direction (x,y,z) = ("<<recRpcTrigger.getTrack(0).direction().x()<<","<<recRpcTrigger.getTrack(0).direction().y()
                        <<","<<recRpcTrigger.getTrack(0).direction().z()<<")"<<std::endl;          
    std::cout<<"Start point (x,y,z) = ("<<recRpcTrigger.getTrack(0).start()->position().x()<<","<<recRpcTrigger.getTrack(0).start()->position().y()<<","
                        <<","<<recRpcTrigger.getTrack(0).start()->position().z()<<")"<<std::endl;
    std::cout<<"End point (x,y,z) = ("<<recRpcTrigger.getTrack(0).end()->position().x()<<","<<recRpcTrigger.getTrack(0).end()->position().y()<<","
                        <<recRpcTrigger.getTrack(0).end()->position().z()<<")"<<std::endl;
    if(recRpcTrigger.is4of4())std::cout<<"This is 4 ouf 4 event!"<<std::endl;
        std::cout<<"Max num of Hits in a Layer = "<<recRpcTrigger. maxHitsInLayer()<<std::endl;
   }
   else if(recRpcTrigger.eventType()==3) //shower
   {
    std::cout<<"This is a shower with "<<recRpcTrigger.numCluster()<<" clusters"<<std::endl;       
    for(int i=0;i<recRpcTrigger.numCluster();i++)
    {
    std::cout<<"(x,y,z) = ("<<recRpcTrigger.getCluster(i)->position().x()<<","<<recRpcTrigger.getCluster(i)->position().y()
            <<","<<recRpcTrigger.getCluster(i)->position().z()<<")"<<std::endl;
    if(recRpcTrigger.is4of4())std::cout<<"This is 4 ouf 4 event!"<<std::endl;
    std::cout<<"Max num of Hits in a Layer = "<<recRpcTrigger. maxHitsInLayer()<<std::endl; 
    }
   }
   else
   {
           std::cout<<"--------------------Wrong:No event Type!------------------------"<<std::endl;
   }
   std::cout<<"******************************************************************"<<std::endl;
 */ 
   return StatusCode::SUCCESS;
}
StatusCode SimpRpcRecTool::initialize ( ) [virtual]

Definition at line 95 of file SimpRpcRecTool.cc.

{
  // Get Cable Service
  //m_cableSvc = svc<ICableSvc>(m_cableSvcName,true);
  //m_calibDataSvc = svc<ICalibDataSvc>(m_calibDataSvcName,true);

  // Get RpcGeomInfo Service
  m_rpcGeomSvc = svc<IRpcGeomInfoSvc>(m_rpcGeomSvcName, true);
  if(!m_rpcGeomSvc) {
    error() << "Can't initialize Rpc geometry service." << endreq;
    return StatusCode::FAILURE;
  }
  std::cout<<"Initialization!"<<std::endl;

  return StatusCode::SUCCESS;
}
StatusCode SimpRpcRecTool::finalize ( ) [virtual]

Definition at line 112 of file SimpRpcRecTool.cc.

{
  if(lessThan3Errs>0)
          error() <<"Less than 3 layers having hits have happed for "<<lessThan3Errs<<" Times"<< endreq;
  return StatusCode::SUCCESS;
}
void SimpRpcRecTool::clustering ( triggerModuleList triggerList,
DayaBay::RecRpcTrigger recRpcTrigger,
const CalibReadoutRpcCrate::RpcChannelReadouts rpcChList,
int  clusterType 
)

Definition at line 314 of file SimpRpcRecTool.cc.

{
 if(triggerList->size()==0)
 { 
 recRpcTrigger.setEventType(0);// no trigger on the RPC array   
 return;
 }
 if(triggerList->size()==1)
 {
  CalibReadoutRpcCrate::RpcChannelReadouts* selectedRpcChReadouts = getRpcChannelList(triggerList,rpcChList);  
  int maxHitsinLayer = 0;
  bool is4of4 = false;
  countHitLayer(triggerList,selectedRpcChReadouts, maxHitsinLayer,is4of4); 
  writeClusterPos(selectedRpcChReadouts,recRpcTrigger,clusterType,maxHitsinLayer,is4of4);
  recRpcTrigger.setEventType(1);
  delete selectedRpcChReadouts;
 }
 else
 {
  clusterTriggerModuleList* triggerClusterList = getClusterList(triggerList); 
  for(int i=0;i<triggerClusterList->size();i++)
  {
    triggerModuleList* tmList = triggerClusterList->at(i);
    CalibReadoutRpcCrate::RpcChannelReadouts* selectedRpcChReadouts = getRpcChannelList(tmList,rpcChList);
    int maxHitsinLayer = 0;
    bool is4of4 = false;
    countHitLayer(tmList,selectedRpcChReadouts, maxHitsinLayer,is4of4);                                                                        
    writeClusterPos(selectedRpcChReadouts,recRpcTrigger,clusterType,maxHitsinLayer,is4of4);
    delete selectedRpcChReadouts;
  }
  if(1==triggerClusterList->size())
  {
   if(triggerClusterList->at(0)->size()<=numOfTrigModuleInCluster)  
   {
   recRpcTrigger.setEventType(1);// 1:point, 2:track, 3:shower   
   }
   else //shower
   {
   recRpcTrigger.setEventType(3);
   }
  }
  else
  {
   recRpcTrigger.setEventType(3);
  }
  //free memory
  for(int i=0;i<triggerClusterList->size();i++)
  {
  delete triggerClusterList->at(i);
  }       
  delete triggerClusterList;

 }
 
}
CalibReadoutRpcCrate::RpcChannelReadouts* SimpRpcRecTool::getRpcChannelList ( int  row,
int  col,
const CalibReadoutRpcCrate::RpcChannelReadouts &  rpcChList 
)
CalibReadoutRpcCrate::RpcChannelReadouts* SimpRpcRecTool::getRpcChannelList ( triggerModuleList triggerList,
const CalibReadoutRpcCrate::RpcChannelReadouts &  rpcChList 
)
SimpRpcRecTool::clusterTriggerModuleList * SimpRpcRecTool::getClusterList ( triggerModuleList triggerList)

Definition at line 432 of file SimpRpcRecTool.cc.

{
        clusterTriggerModuleList*  triggerClusters = new clusterTriggerModuleList();
        triggerModuleList* triggerMList = new triggerModuleList(*triggerList);

        while(triggerMList->size()>0)
        {
                triggerModuleList* cls = new triggerModuleList();
                int nfound = 1;

                while (nfound > 0)
                {
                        nfound = 0;
                        int totTriggers = triggerMList->size();
                        for (int n=0;n<totTriggers;n++)
                        {
                                int row = triggerMList->at(n)/10;
                                int col = triggerMList->at(n)%10;
                                if (cls->size() == 0)
                                {
                                        cls->push_back(row*10+col);
                                        nfound += 1;
                                }
                                else
                                {
                                        int flg = 0;

                                        for (int m=0;m<cls->size();m++)
                                        {
                                                int rd = cls->at(m)/10 - row;
                                                int cd = cls->at(m)%10 - col;
                                                if (rd<=1&&rd>=-1&&cd<=1&&cd>=-1) flg = 1;
                                        }
                                        if (flg > 0)
                                        {
                                                cls->push_back(triggerMList->at(n));
                                                nfound += 1;
                                        }
                                }
                        }

        triggerModuleList* tmpTriggerList = new triggerModuleList(*triggerMList);
        int t = tmpTriggerList->size();

        triggerMList->clear();//empty();

        for (int i=0;i<t;i++)
        {
        int matched = -1;
        for(int j=0;j<cls->size();j++ )
        {
        if(cls->at(j)==tmpTriggerList->at(i))
        {
         matched = 1;
         break;
        }

        }
        if(matched == -1)  triggerMList->push_back(tmpTriggerList->at(i));
        }
         delete tmpTriggerList;
        }
                
   triggerClusters->push_back(cls);;
  }
  delete triggerMList;  
  return triggerClusters;       
}
void SimpRpcRecTool::writeClusterPos ( CalibReadoutRpcCrate::RpcChannelReadouts rpcChList,
DayaBay::RecRpcTrigger recRpcTrigger,
int  type,
int  maxLayer,
bool  is4of4 
)

Definition at line 500 of file SimpRpcRecTool.cc.

{
        int numOfXLayers = 0;
        int numOfYLayers = 0;
        double x = 0.0;
        double y = 0.0;
        double z = 0.0;
        CalibReadoutRpcCrate::RpcChannelReadouts::const_iterator chanIter;
        for(chanIter=rpcChList->begin();
                        chanIter != rpcChList->end();
                        chanIter++)
        {
                const CalibReadoutRpcChannel& channel = *chanIter;
                int rpcid = channel.rpcSensorId().fullPackedData();
                const RpcSensor& detSensor = (RpcSensor&)channel.rpcSensorId();
                int layer = detSensor.layer() ;
                IRpcGeomInfo *rpcGeomInfo = m_rpcGeomSvc->get(rpcid);
                 if (!rpcGeomInfo) { 
                   error() << "Failed to get an RpcGeomInfo for RPC ID " << rpcid << ", skipping" << endreq; 
                   continue; 
                 } 

                z  += rpcGeomInfo->localPosition().z();
                if(layer%3==1) //x-strip layer
                {   x += rpcGeomInfo->localPosition().x();
                        numOfXLayers++;
                }
                else  //y-strip layer
                { 
                        y +=rpcGeomInfo->localPosition().y();
                        numOfYLayers++;
                }
         }              
         if(numOfXLayers+numOfYLayers<3)
         {
                 if(lessThan3Errs <=5)
                 {       
                 info()<<"Info:Less than 3 layers have Hits!"<<endreq;
                 info()<<"Num of X layers = "<<numOfXLayers<<",Num of Y layers = "<<numOfYLayers<<endreq;
                 }
                 lessThan3Errs++;
         }
                x = x/numOfXLayers + x_offset[EH];
                y = y/numOfYLayers + y_offset[EH] ;
                z = z/(numOfXLayers+numOfYLayers)+z_offset[EH];
                DayaBay::RecRpcCluster* rpcCluster = new RecRpcCluster(CLHEP::HepLorentzVector(x,y,z));
                rpcCluster->setIs4of4(is4of4);
                rpcCluster->setMaxHitsInLayer(maxLayer);
                rpcCluster->setType(RecRpcCluster::ClusterType(clusterType));
                recRpcTrigger.addCluster(rpcCluster);
                //delete rpcCluster;
                debug() << "Recontructed Position(x,y,z) from Clustering Method ="<<"("<<x<<","<<y<<","<<z<<")" <<endreq;
//              std::cout<< "Recontructed Position(x,y,z) from Clustering Method ="<<"("<<x<<","<<y<<","<<z<<")" <<std::endl;
}
void SimpRpcRecTool::writeTeleScopePosIntoTrk ( CalibReadoutRpcCrate::RpcChannelReadouts rpcChList,
DayaBay::RecRpcTrack recRpcTrk 
)

Definition at line 556 of file SimpRpcRecTool.cc.

{                               
        int numOfXLayers = 0;   
        int numOfYLayers = 0;   
        double x = 0.0;                 
        double y = 0.0;
        double z = 0.0;                 
        CalibReadoutRpcCrate::RpcChannelReadouts::const_iterator chanIter;
        for(chanIter=rpcChList->begin();        
                        chanIter != rpcChList->end();
                        chanIter++)             
        {                               
                const CalibReadoutRpcChannel& channel = *chanIter;
                int rpcid = channel.rpcSensorId().fullPackedData();
                const RpcSensor& detSensor = (RpcSensor&)channel.rpcSensorId();
                int layer = detSensor.layer() ; 
                IRpcGeomInfo *rpcGeomInfo = m_rpcGeomSvc->get(rpcid);
                if (!rpcGeomInfo) {
                        error() << "Failed to get an RpcGeomInfo for RPC ID " << rpcid << ", skipping" << endreq;
                        continue;
                }
                z  += rpcGeomInfo->localPosition().z();
                if(layer%3==1) //x-strip layer
                {   x += rpcGeomInfo->localPosition().x();
                        numOfXLayers++;
                }
                else  //y-strip layer
                { 
                        y +=rpcGeomInfo->localPosition().y();
                        numOfYLayers++;
                }
        }              
        x = x/numOfXLayers + x_offset[EH];
        y = y/numOfYLayers + y_offset[EH] ;
        z = z/(numOfXLayers+numOfYLayers)+z_offset[EH];
        DayaBay::RecRpcCluster* rpcCluster = new RecRpcCluster(CLHEP::HepLorentzVector(x,y,z));
        rpcCluster->setType(RecRpcCluster::ClusterType(2));
        recRpcTrk.setStart(rpcCluster);
        delete rpcCluster;
//      std::cout<< "Recontructed Position(x,y,z) from Clustering Method ="<<"("<<x<<","<<y<<","<<z<<")" <<std::endl;
}
int SimpRpcRecTool::getRpcChannelList ( int  row,
int  col,
int  layer,
const CalibReadoutRpcCrate::RpcChannelReadouts &  rpcChList 
)
bool SimpRpcRecTool::checkHitLayer ( triggerModuleList triggerList,
const CalibReadoutRpcCrate::RpcChannelReadouts rpcChList 
)

Definition at line 598 of file SimpRpcRecTool.cc.

{
  for(int i=0;i<triggerList->size();i++)
  {
    int r = triggerList->at(i)/10;
    int c = triggerList->at(i)%10;
    int layerHit[4];
    for(int l=0;l<4;l++)
    {
    layerHit[l] = 0;
    if(getRpcChannelList(r,c,l+1,rpcChList)>0)
    layerHit[l] = 1 ;
    }
    if(layerHit[0]+layerHit[1]+layerHit[2]+layerHit[3]<3)
    {
     if(lessThan3Errs <=5 )
     {
       info() << "Less than 3 layers have hit in a module sending out a trigger(3 out of 4 mode)" << endreq;        
     }
     lessThan3Errs++;
    
     return false;
     }
   }
  return true;
}
void SimpRpcRecTool::countHitLayer ( triggerModuleList triggerList,
CalibReadoutRpcCrate::RpcChannelReadouts rpcChList,
int &  maximum,
bool &  is4of4 
)

Definition at line 624 of file SimpRpcRecTool.cc.

{
    int maxLayer = 0;   
    int maxStrip = 0;
        for(int i=0;i<triggerList->size();i++)
        {
                int r = triggerList->at(i)/10;
                int c = triggerList->at(i)%10;
                int layerHit[4];

                for(int l=0;l<4;l++)
                {
                        layerHit[l] = 0;
                        int numHits = getRpcChannelList(r,c,l+1,*rpcChList);
                        if(numHits > 0)
                                layerHit[l] = 1 ;
                        if(numHits > maxStrip)
                                maxStrip = numHits;
                }
                if(maxLayer < layerHit[0]+layerHit[1]+layerHit[2]+layerHit[3])
                 maxLayer = layerHit[0]+layerHit[1]+layerHit[2]+layerHit[3];
        }
   if(maxLayer==4) is4of4 = true;
   else is4of4 = false;
   maximum = maxStrip;

  return;
}

Member Data Documentation

std::string SimpRpcRecTool::m_cableSvcName [private]

Definition at line 58 of file SimpRpcRecTool.h.

Definition at line 61 of file SimpRpcRecTool.h.

std::string SimpRpcRecTool::m_calibDataSvcName [private]

Definition at line 64 of file SimpRpcRecTool.h.

Definition at line 67 of file SimpRpcRecTool.h.

std::string SimpRpcRecTool::m_rpcGeomSvcName [private]

Definition at line 70 of file SimpRpcRecTool.h.

Definition at line 73 of file SimpRpcRecTool.h.

Definition at line 74 of file SimpRpcRecTool.h.

Definition at line 75 of file SimpRpcRecTool.h.

double SimpRpcRecTool::x_offset[4] [private]

Definition at line 76 of file SimpRpcRecTool.h.

double SimpRpcRecTool::y_offset[4] [private]

Definition at line 77 of file SimpRpcRecTool.h.

double SimpRpcRecTool::z_offset[4] [private]

Definition at line 78 of file SimpRpcRecTool.h.

int SimpRpcRecTool::EH [private]

Definition at line 79 of file SimpRpcRecTool.h.

int SimpRpcRecTool::numOfRow [private]

Definition at line 80 of file SimpRpcRecTool.h.

int SimpRpcRecTool::numOfCol [private]

Definition at line 81 of file SimpRpcRecTool.h.

Definition at line 82 of file SimpRpcRecTool.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 10:12:45 for RpcRec by doxygen 1.7.4