BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//____________________________________________________________________
//
// A module to select good collisisons from pp collisions.  Ordinarily
// this would be done using the Inel counters.  However,there was
// a part of the run where the overlap between trig 3 (MRS trigger)
// and the Inel counters appears to have been non-existent.  This is
// an attempt to resurrect that data.  The filter will pass if
// either an Inel signal inside the proper range is found or the
// projection of the MRS track is found inside the proper limit
//
// $Id: BrPpCollisionFilter.cxx,v 1.1 2002/08/30 17:05:55 hagel Exp $
// $Author: hagel $
// $Date: 2002/08/30 17:05:55 $
// $Copyright: 2000 BRAHMS Collaboration 
//

#ifndef ROOT_TDirectory
#include "TDirectory.h"
#endif
#include "BrPpCollisionFilter.h"
#include "BrEvent.h"
#include "BrEventHeader.h"
#include "BrDetectorList.h"
#include "BrZdcRdo.h"
#include "BrBbRdo.h"
#include "BrBbVertex.h"
#include "BrVertex.h"
#include <BrIostream.h>
#include "TH2.h"
//____________________________________________________________________
ClassImp(BrPpCollisionFilter);


//____________________________________________________________________
 BrPpCollisionFilter::BrPpCollisionFilter() 
{
  // Default constructor 
  SetState(kSetup);
  fNoTimesCalled     = 0;
  SetMaxZdcVertexZ();
  SetMaxBbVertexZ();
}


//____________________________________________________________________
 BrPpCollisionFilter::BrPpCollisionFilter(const Char_t* name, 
				     const Char_t* title) 
  : BrVertexFilter(name, title)
{
  // Default constructor 
  SetState(kSetup);
  SetMaxInelVertexZ();
  SetMaxProjectionVertexZ();
}

//_______________________________________________________
 void BrPpCollisionFilter::Init() {
  //Init

   BrVertexFilter::Init();

  //Following are to make it do what we want and use results the way we
  //want.
  DemandInelVertex();
  DemandProjectionVertex();
}

//_______________________________________________________
 void BrPpCollisionFilter::DefineHistograms()
{
  // Define histograms

  BrVertexFilter::DefineHistograms(); 

  // remember current directory
  TDirectory* savdir = gDirectory;   
  // Make directory for this module 
  if (!gDirectory->cd("vertex")) {
    Warning("DefineHistograms","could not cd to histogram subdirectory");
    return;
  }

  fAllInelProj = new TH2F("AllInelProj","AllInelProj",100,-600,600,100,-600,600);
  fAccInelProj = new TH2F("AccInelProj","AccInelProj",100,-600,600,100,-600,600);
  // Restore directory
  gDirectory = savdir;
}

//_______________________________________________________
 void BrPpCollisionFilter::Event(BrEventNode* input, BrEventNode* output)
{
  // Return with status set to kDisaster if the input was not a
  // BrEvent object, or the trigger mask doesn't fit with the selected
  // triggers. 
  SetState(kEvent);
  SetStatus(kOk);

  fNoTimesCalled++;

  // Inspect the Inel vertex 
  Bool_t statInel = CheckInelVertex(input);
  if(!statInel) statInel = CheckInelVertex(output);
  Int_t statusFromInel = GetStatus();

  SetStatus(kOk);
  Bool_t statProj = CheckProjectionVertex(input);
  if(!statProj) statProj = CheckProjectionVertex(output);
  Int_t statusFromProj = GetStatus();

  //printf("statInel = %d, statusFromInel = %d, statProj = %d, statusFromProj = %dn",statInel,statusFromInel,statProj,statusFromProj);
  fAllInelProj->Fill(fCurrentInelVertexZ,fCurrentProjectionVertexZ);
  if(statusFromInel < kStop || statusFromProj < kStop) {
     SetStatus(kOk);
     fAccInelProj->Fill(fCurrentInelVertexZ,fCurrentProjectionVertexZ);
     }
  else {
     SetStatus(kStop);
     }

/*
  Bool_t statProj = kFALSE;
  if(!statInel) {
     //Means there was no Inel vertex object.  So, check projection vertex
     statProj = CheckProjectionVertex(input);
     if(!statProj) statProj = CheckProjectionVertex(output);
     if(!statProj) return;  //return if we had neither.
     if(GetStatus() >= kStop) return;  //return if out of proj vertex limit
     }
  else {
     //There was an Inel vertex object.  Check its status and react 
     //appropriately
     fAllInelProj->Fill(fCurrentInelVertexZ,fCurrentProjectionVertexZ);
     if (GetStatus() >= kStop) return;  //return if out of Inel vertex limit
     }

  SetStatus(kOk);
*/
}
 
//____________________________________________________________________
 void BrPpCollisionFilter::Print(Option_t* option) const
{
  // Print info on module
  BrModule::Print(option);
  TString opt(option);
  opt.ToLower();
  
  if (opt.Contains("s")) {
    BrVertexFilter::Print("s");    
    cout << "BrPpCollisionFilter Statistic Summary" << endl;
    //<< " Events after BB-ZDC : " << setw(8)
    // << fNoAcceptedBBZDC  << endl; 
  }
  if (opt.Contains("d")) {
    BrVertexFilter::Print("d");
    cout << "  Original author: K. Hagel" << endl
	 << "    $Author: hagel $" << endl
	 << "    $Date: 2002/08/30 17:05:55 $"   << endl
	 << "    $Revision: 1.1 $ " << endl
	 << endl
	 << "*************************************************" << endl;
  }
  
  
}

//
// $Log: BrPpCollisionFilter.cxx,v $
// Revision 1.1  2002/08/30 17:05:55  hagel
// Initial revision
//

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on by

Validate HTML
Validate CSS