/////////////////////////////////////////////////////////////////////////////
//
// EEsmdIsoClusters
//
// Author: Jason C. Webb <jwebb@iucf.indiana.edu>
//
// A class to identify "isolated" clusters... where isolated is in the
// sense that there are no ambiguities in interpreting the SMD response
// in either the U or V planes.
//
// For now, a cluster is considered isolated if all towers which lie along
// the SMD strips shared by its seed tower respond below a specified energy
// threshold.
//
/////////////////////////////////////////////////////////////////////////////

#include "EEsmdIsoClusters.h"
#include "StEEmcUtil/EEmcSmdMap/EEmcSmdMap.h"

#include "EEezTower.h"
#include "EEezStrip.h"
#include "EEezCluster.h"

#include "EEezAnalysis.h"
#include "EEezClAnalysis.h"

#include <iostream>

ClassImp(EEsmdIsoClusters);

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

 EEsmdIsoClusters::EEsmdIsoClusters( const Char_t *myName, const Char_t *myTitle )
  : TDirectory ( myName, myTitle )
{
  // Class constructor

  mEEsmdMap = EEmcSmdMap::instance();

  mMaxSharedSum = 0.5; //GeV -- Default cut on towers sharing SMD strips

}

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

 Int_t EEsmdIsoClusters::Init() 
{
  // Performs class initialization.

  return 1;
}

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

 Int_t EEsmdIsoClusters::Make()
{
  // Loops over all clusters identified by the cluster finder and 
  // determines if they passed or failed the isolation condition.
  
  /*
  //-- Get a pointer to the clusters identified by the cluster
  //-- finder.  BE CAREFUL.  We can overwrite cluster information
  //-- which may be used in other parallel analyses!
  EEezClusterVec_t *clusters = mEEmcClusters -> getPointerToClusters();

  //-- Loop over all clusters
  EEezClusterVecIter_t iter = clusters -> begin();
  while ( iter != clusters -> end() ) {
  */

  for ( Int_t ic = 0; ic < mEEmcClusters -> getNClusters(); ic++ ) {

    //-- Get a pointer to the cluster
    EEezCluster *cluster = mEEmcClusters -> getClusterPtr(ic);

    //-- Get the seed tower
    EEezTower *seed = cluster -> getSeedTower();
    Int_t sec = seed -> getSector();    // 0..11
    Int_t sub = seed -> getSubSector(); // 0..4
    Int_t eta = seed -> getEtabin();    // 0..11

    //-- Get the strip ID's which are in the center of the tower
    Int_t umid, vmid;
    mEEsmdMap -> getMiddleU( sec,sub,eta, umid );
    mEEsmdMap -> getMiddleV( sec,sub,eta, vmid );

    //-- Get the number of towers which lay along these strips
    Int_t nu = mEEsmdMap -> getNTowers( sec, 0, umid );
    Int_t nv = mEEsmdMap -> getNTowers( sec, 1, vmid );

    //-- Energy sums of towers along U and V directions
    Float_t energySumU = 0.;
    Float_t energySumV = 0.;

    //-- Loop over towers shared by U strips
    for ( Int_t iu = 0; iu < nu; iu++ ) {

      //-- Next tower in list
      Int_t mySub, myEta;
      mEEsmdMap -> getTower ( sec, 0, umid, iu, mySub, myEta );

      EEezTower *tower = mEEmcAnalysis -> getTower ( sec, mySub, myEta );
      //-- If the tower does not "belong" to the cluster,
      //-- increment the energy sum
      if ( !cluster -> hasTower( tower ) )
	energySumU += tower -> getEnergy();
      

    }

    //-- Loop over towers whared by V strips
    for ( Int_t iv = 0; iv < nv; iv++ ) {

      //-- Next tower in list
      Int_t mySub, myEta;
      mEEsmdMap -> getTower ( sec, 1, vmid, iv, mySub, myEta );

      EEezTower *tower = mEEmcAnalysis -> getTower ( sec, mySub, myEta );
      //-- If the tower does not "belong" to the cluster,
      //-- increment the energy sum
      if ( !cluster -> hasTower( tower ) )
	energySumV += tower -> getEnergy();

    }

    //--
    //-- If the cluster is properly isolated, add it to our
    //-- vector of isolated clusters.
    
    if ( energySumU < mMaxSharedSum &&
	 energySumV < mMaxSharedSum ) {
      
      mClusters.push_back( cluster );

    }
    

  }//-- Loop over clusters
  
  return 1;

}

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

 void EEsmdIsoClusters::Clear ( Option_t *opts ) 
{
  // Clears the vector of isolated clusters in preparation for processing
  // another event

  mClusters.clear();

}

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.