CMS 3D CMS Logo

Public Member Functions | Private Member Functions

MuonNavigationPrinter Class Reference

#include <MuonNavigationPrinter.h>

List of all members.

Public Member Functions

 MuonNavigationPrinter (const MuonDetLayerGeometry *, bool enableRPC=true)
 MuonNavigationPrinter (const MuonDetLayerGeometry *, const GeometricSearchTracker *)

Private Member Functions

void printLayer (DetLayer *) const
 print layer
void printLayers (std::vector< const DetLayer * >) const
 print next layers

Detailed Description

Description: class to print the MuonNavigationSchool

Date:
2007/06/14 20:31:31
Revision:
1.7
Author:
: Stefano Lacaprara - INFN Padova <stefano.lacaprara@pd.infn.it>

Modification:

Chang Liu: The class prints nextLayers and compatibleLayers Add new constructor for MuonTkNavigationSchool

Description: class to print the MuonNavigationSchool

Date:
2007/06/14 20:32:59
Revision:
1.10
Author:
: Stefano Lacaprara - INFN Padova <stefano.lacaprara@pd.infn.it>

Modification:

Chang Liu: add compatibleLayers add constructor for MuonTkNavigation

Definition at line 28 of file MuonNavigationPrinter.h.


Constructor & Destructor Documentation

MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
bool  enableRPC = true 
)

Definition at line 33 of file MuonNavigationPrinter.cc.

References MuonDetLayerGeometry::allBackwardLayers(), MuonDetLayerGeometry::allBarrelLayers(), MuonDetLayerGeometry::allDTLayers(), MuonDetLayerGeometry::allForwardLayers(), MuonDetLayerGeometry::backwardCSCLayers(), Reference_intrackfit_cff::barrel, and MuonDetLayerGeometry::forwardCSCLayers().

                                                                                                    {

  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
  vector<DetLayer*>::const_iterator iter;
  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
  vector<DetLayer*> barrel;
  if ( enableRPC ) barrel = muonLayout->allBarrelLayers();
  else barrel = muonLayout->allDTLayers();

  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Barrel DetLayers";
  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
  edm::LogInfo ("MuonNavigationPrinter")  << "BACKWARD:";

  vector<DetLayer*> backward;
  if ( enableRPC ) backward = muonLayout->allBackwardLayers();
  else backward = muonLayout->backwardCSCLayers();

  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Backward DetLayers";
  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
  vector<DetLayer*> forward;
  if ( enableRPC ) forward = muonLayout->allForwardLayers();
  else forward = muonLayout->forwardCSCLayers();

  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Forward DetLayers";
  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);

}
MuonNavigationPrinter::MuonNavigationPrinter ( const MuonDetLayerGeometry muonLayout,
const GeometricSearchTracker tracker 
)

for ( tkfiter = tkbackward.begin(); tkfiter != tkbackward.end(); tkfiter++ ) printLayer(*tkfiter);

Definition at line 65 of file MuonNavigationPrinter.cc.

References MuonDetLayerGeometry::allBackwardLayers(), MuonDetLayerGeometry::allBarrelLayers(), MuonDetLayerGeometry::allForwardLayers(), Reference_intrackfit_cff::barrel, GeometricSearchTracker::barrelLayers(), GeometricSearchTracker::negForwardLayers(), and GeometricSearchTracker::posForwardLayers().

                                                                                                                            {

  edm::LogInfo ("MuonNavigationPrinter")<< "MuonNavigationPrinter::MuonNavigationPrinter" ;
  vector<DetLayer*>::const_iterator iter;
//  vector<BarrelDetLayer*>::const_iterator tkiter;
//  vector<ForwardDetLayer*>::const_iterator tkfiter;
  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
  edm::LogInfo ("MuonNavigationPrinter")<< "BARREL:";
  vector<BarrelDetLayer*> tkbarrel = tracker->barrelLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbarrel.size()<<" Tk Barrel DetLayers";
//  for ( tkiter = tkbarrel.begin(); tkiter != tkbarrel.end(); tkiter++ ) printLayer(*tkiter);
  vector<DetLayer*> barrel = muonLayout->allBarrelLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<barrel.size()<<" Mu Barrel DetLayers";
  for ( iter = barrel.begin(); iter != barrel.end(); iter++ ) printLayer(*iter);
  edm::LogInfo ("MuonNavigationPrinter")<<"================================";
  edm::LogInfo ("MuonNavigationPrinter")  << "BACKWARD:";
  vector<ForwardDetLayer*> tkbackward = tracker->negForwardLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkbackward.size()<<" Tk Backward DetLayers";
  vector<DetLayer*> backward = muonLayout->allBackwardLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<backward.size()<<" Mu Backward DetLayers";
  for ( iter = backward.begin(); iter != backward.end(); iter++ ) printLayer(*iter);
  edm::LogInfo ("MuonNavigationPrinter") << "==============================";
  edm::LogInfo ("MuonNavigationPrinter") << "FORWARD:";
  vector<ForwardDetLayer*> tkforward =  tracker->posForwardLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<tkforward.size()<<" Tk Forward DetLayers";
//  for ( tkfiter = tkforward.begin(); tkfiter != tkforward.end(); tkfiter++ ) printLayer(*tkfiter);

  vector<DetLayer*> forward = muonLayout->allForwardLayers();
  edm::LogInfo ("MuonNavigationPrinter")<<"There are "<<forward.size()<<" Mu Forward DetLayers";
  for ( iter = forward.begin(); iter != forward.end(); iter++ ) printLayer(*iter);

}

Member Function Documentation

void MuonNavigationPrinter::printLayer ( DetLayer layer) const [private]

print layer

Definition at line 100 of file MuonNavigationPrinter.cc.

References BoundSurface::bounds(), DetLayer::compatibleLayers(), insideOut, Bounds::length(), DetLayer::location(), DetLayer::nextLayers(), outsideIn, GloballyPositioned< T >::position(), DetLayer::subDetector(), and GeometricSearchDet::surface().

                                                            {
  vector<const DetLayer*> nextLayers = layer->nextLayers(insideOut);
  vector<const DetLayer*> compatibleLayers = layer->compatibleLayers(insideOut);
  if (BarrelDetLayer* bdl = dynamic_cast<BarrelDetLayer*>(layer)) {
    edm::LogInfo ("MuonNavigationPrinter") 
         << layer->location() << " " << layer->subDetector() << " layer at R: "
         << setiosflags(ios::showpoint | ios::fixed)
         << setw(8) << setprecision(2)
         << bdl->specificSurface().radius() << "  length: "
         << setw(6) << setprecision(2)
         << layer->surface().bounds().length();
          
  }
  else if (ForwardDetLayer* fdl = dynamic_cast<ForwardDetLayer*>(layer)) {
    edm::LogInfo ("MuonNavigationPrinter") << endl
         << layer->location() << " " << layer->subDetector() << "layer at z: "
         << setiosflags(ios::showpoint | ios::fixed)
         << setw(8) << setprecision(2)
         << layer->surface().position().z() << "  inner r: "
         << setw(6) << setprecision(2)
         << fdl->specificSurface().innerRadius() << "  outer r: "
         << setw(6) << setprecision(2)
         << fdl->specificSurface().outerRadius();
  }
  edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction inside-out: ";
  printLayers(nextLayers);

  nextLayers.clear();
  nextLayers = layer->nextLayers(outsideIn);

   edm::LogInfo ("MuonNavigationPrinter") << " has " << nextLayers.size() << " next layers in the direction outside-in: ";
  printLayers(nextLayers);

  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction inside-out:: ";
  printLayers(compatibleLayers);
  compatibleLayers.clear();
  compatibleLayers = layer->compatibleLayers(outsideIn);
  
  edm::LogInfo ("MuonNavigationPrinter") << " has " << compatibleLayers.size() << " compatible layers in the direction outside-in: ";
  printLayers(compatibleLayers);

}
void MuonNavigationPrinter::printLayers ( std::vector< const DetLayer * >  ) const [private]

print next layers

Definition at line 144 of file MuonNavigationPrinter.cc.

References Reference_intrackfit_cff::barrel, prof2calltree::l, GloballyPositioned< T >::position(), Cylinder::radius(), BarrelDetLayer::specificSurface(), and ForwardDetLayer::surface().

                                                                                {

  for ( vector<const DetLayer*>::const_iterator inext = nextLayers.begin();
      inext != nextLayers.end(); inext++ ) {

     edm::LogInfo ("MuonNavigationPrinter") << " --> "; 
     if ( (*inext)->location() == GeomDetEnumerators::barrel ) {
      const BarrelDetLayer* l = dynamic_cast<const BarrelDetLayer*>(&(**inext));
      edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
           << (*inext)->subDetector()
           << " layer at R: "
           << setiosflags(ios::showpoint | ios::fixed)
           << setw(8) << setprecision(2)
           << l->specificSurface().radius() << "   ";
    }
    else {
      const ForwardDetLayer* l = dynamic_cast<const ForwardDetLayer*>(&(**inext));
       edm::LogInfo ("MuonNavigationPrinter") << (*inext)->location() << " "
           << (*inext)->subDetector()
           << " layer at z: "
           << setiosflags(ios::showpoint | ios::fixed)
           << setw(8) << setprecision(2)
           << l->surface().position().z() << "   ";
    }
    edm::LogInfo ("MuonNavigationPrinter") << setiosflags(ios::showpoint | ios::fixed)
         << setprecision(1)
         << setw(6) << (*inext)->surface().bounds().length() << ", "
         << setw(6) << (*inext)->surface().bounds().width() << ", "
         << setw(4) <<(*inext)->surface().bounds().thickness() << " : " 
         << (*inext)->surface().position();
  }

}