CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoLocalMuon/CSCRecHitD/src/CSCStripHit.cc

Go to the documentation of this file.
00001 #include "RecoLocalMuon/CSCRecHitD/src/CSCStripHit.h"
00002 #include <iostream>
00003 
00004 CSCStripHit::CSCStripHit() :
00005   theDetId(),
00006   theStripHitPosition(),
00007   theStripHitTmax(),     
00008   theStrips(),
00009   theStripHitADCs(),
00010   theStripHitRawADCs(),
00011   theConsecutiveStrips(),
00012   theClosestMaximum(),
00013   theDeadStrip()
00014 {
00015 
00017 theStripsLowBits.clear();
00018 for(int i=0; i<(int)theStrips.size(); i++){
00019         theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
00020         }
00022 theStripsHighBits.clear();
00023 for(int i=0; i<(int)theStrips.size(); i++){
00024         theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
00025         }
00026         
00027 }
00028 
00029 CSCStripHit::CSCStripHit( const CSCDetId& id, 
00030                           const float& sHitPos, 
00031                           const int& tmax, 
00032                           const ChannelContainer& strips, 
00033                           const StripHitADCContainer& s_adc,
00034                           const StripHitADCContainer& s_adcRaw,
00035                           const int& numberOfConsecutiveStrips,
00036                           const int& closestMaximum,
00037                           const short int & deadStrip) :
00038   theDetId( id ), 
00039   theStripHitPosition( sHitPos ),
00040   theStripHitTmax( tmax ),
00041   theStrips( strips ),
00042   theStripHitADCs( s_adc ),
00043   theStripHitRawADCs( s_adcRaw ),
00044   theConsecutiveStrips(numberOfConsecutiveStrips),
00045   theClosestMaximum(closestMaximum),
00046   theDeadStrip(deadStrip)
00047 {
00048 
00050 theStripsLowBits.clear();
00051 for(int i=0; i<(int)theStrips.size(); i++){
00052         theStripsLowBits.push_back(theStrips[i] & 0x000000FF);
00053         }
00055 theStripsHighBits.clear();
00056 for(int i=0; i<(int)theStrips.size(); i++){
00057         theStripsHighBits.push_back(theStrips[i] & 0x0000FF00);
00058         }
00059         
00060 }
00061 
00062 CSCStripHit::~CSCStripHit() {}
00063 
00064 
00066 void
00067 CSCStripHit::print() const {
00068   std::cout << "CSCStripHit in CSC Detector: " << std::dec << cscDetId() << std::endl;
00069   std::cout << "  sHitPos: " << sHitPos() << std::endl;
00070   std::cout << "  TMAX: " << tmax() << std::endl;
00071   std::cout << "  STRIPS: ";
00072   for (int i=0; i<(int)strips().size(); i++) {std::cout << std::dec << strips()[i] 
00073        << " (" << "HEX: " << std::hex << strips()[i] << ")" << " ";}
00074   std::cout << std::endl;
00075 
00077   std::cout << "  L1APhase: ";
00078   for (int i=0; i<(int)stripsl1a().size(); i++) {
00079        //uint16_t L1ABitSet=(strips()[i] & 0xFF00);
00080        //std::cout << std::hex << (stripsl1a()[i] >> 15)<< " ";
00081        
00082        std::cout << "|";
00083        for (int k=0; k<8 ; k++){ 
00084        std::cout << ((stripsl1a()[i] >> (15-k)) & 0x1) << " ";}
00085        std::cout << "| ";       
00086        }           
00087   std::cout << std::endl;
00088   
00089   std::cout << "  S_ADC: ";
00090   for (int i=0; i<(float)s_adc().size(); i++) {std::cout << s_adc()[i] << " ";}
00091   std::cout << std::endl;
00092   std::cout << "  S_ADC_RAW: ";
00093   for (int i=0; i<(float)s_adcRaw().size(); i++) {std::cout << s_adcRaw()[i] << " ";}
00094   std::cout << std::endl;
00095 }