CMS 3D CMS Logo

VisL1MuDTChambPhContainerTwig Class Reference

#include <VisReco/VisTrigger/interface/VisL1MuDTChambPhContainerTwig.h>

Inheritance diagram for VisL1MuDTChambPhContainerTwig:

VisQueuedTwig IgSimpleTwig VisEventObserver IgCompoundTwig IgTwig IgRepresentable

List of all members.

Public Member Functions

virtual void onNewEvent (const edm::Event &event, const edm::EventSetup &eventSetup)
virtual void update (IgTextRep *rep)
virtual void update (Ig3DRep *rep)
 VisL1MuDTChambPhContainerTwig (IgState *state, IgTwig *parent, const std::string &name, const std::string &friendlyName="", const std::string &moduleLabel="", const std::string &instanceName="", const std::string &processName="")

Private Attributes

QString m_decision
std::string m_friendlyName
std::string m_instanceName
std::string m_moduleLabel
edm::ESHandle< DTGeometrym_muonGeom
std::vector< L1MuDTChambPhDigi > * m_phiContainer
std::string m_processName
IgStatem_state
std::string m_text


Detailed Description

Definition at line 22 of file VisL1MuDTChambPhContainerTwig.h.


Constructor & Destructor Documentation

VisL1MuDTChambPhContainerTwig::VisL1MuDTChambPhContainerTwig ( IgState state,
IgTwig parent,
const std::string &  name,
const std::string &  friendlyName = "",
const std::string &  moduleLabel = "",
const std::string &  instanceName = "",
const std::string &  processName = "" 
)

Definition at line 50 of file VisL1MuDTChambPhContainerTwig.cc.

References createThisTwig(), edm::TypeID::friendlyClassName(), DBSPlugin::get(), and VisTwigFactroyService::registerTwig().

00056     : VisQueuedTwig (state, parent, name),
00057       m_state (state),
00058       m_text ("no info"),
00059       m_friendlyName (friendlyName),
00060       m_moduleLabel (moduleLabel),
00061       m_instanceName (instanceName),
00062       m_processName (processName)
00063 {
00064     VisTwigFactroyService *tfService = VisTwigFactroyService::get (state);
00065     if (! tfService)
00066     {
00067         tfService = new VisTwigFactroyService (state);
00068     }
00069     edm::TypeID triggerID (typeid (L1MuDTChambPhContainer));
00070     tfService->registerTwig (triggerID.friendlyClassName (), &createThisTwig);
00071 }


Member Function Documentation

void VisL1MuDTChambPhContainerTwig::onNewEvent ( const edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 74 of file VisL1MuDTChambPhContainerTwig.cc.

References arg, GenMuonPlsPt100GeV_cfg::cout, e, lat::endl(), exception, edm::EventSetup::get(), i, edm::Event::id(), edm::Handle< T >::isValid(), j, k, m_muonGeom, VisQueuedTwig::m_onCmsException, VisQueuedTwig::m_onError, VisQueuedTwig::m_onException, VisQueuedTwig::m_onUnhandledException, m_phiContainer, m_text, VisQueuedTwig::onBaseInvalidate(), VisQueuedTwig::onNewEvent(), and DetId::rawId().

00076 {    
00077     // Get debugging dump.
00078     VisQueuedTwig::onNewEvent (event, eventSetup);
00079 
00080     m_text = (QString ("Run # %1, event # %2")
00081               .arg (event.id ().run ())
00082               .arg (event.id ().event ()).latin1 ());
00083     try 
00084     {
00085         eventSetup.get<MuonGeometryRecord> ().get (m_muonGeom);
00086     }
00087     catch (cms::Exception& e)
00088     {
00089         if (this->m_onCmsException)
00090             this->m_onCmsException (&e);
00091     }
00092     catch (lat::Error &e) 
00093     {
00094         if (this->m_onError)
00095             this->m_onError (&e);
00096     }
00097     catch (std::exception &e) 
00098     {
00099         if (this->m_onException)
00100             this->m_onException (&e);
00101     }
00102     catch (...) 
00103     {
00104         if (this->m_onUnhandledException)
00105             this->m_onUnhandledException ();
00106     }
00107     
00108     try
00109     {
00110         edm::Handle<L1MuDTChambPhContainer> l1dtlocalphi;
00111         event.getByType (l1dtlocalphi);
00112         if (l1dtlocalphi.isValid ())
00113         {
00114             m_phiContainer = l1dtlocalphi->getContainer();
00115             std::cout << "PhiContainer: " << m_phiContainer->size () << std::endl;
00116 
00117             int phcode_best [6][5][13];
00118             std::vector<L1MuDTChambPhDigi>::const_iterator ibest [6][5][13];
00119 
00120             // define best quality phi trigger segment in any station
00121             // start from 1 and zero is kept empty
00122             for (int i = 0; i < 5; ++i)
00123                 for (int j = 0; j < 6; ++j)
00124                     for (int k = 0; k < 13; ++k)
00125                         phcode_best [j][i][k] = -1;
00126 
00127             for (std::vector<L1MuDTChambPhDigi>::const_iterator i = m_phiContainer->begin (), iEnd = m_phiContainer->end (); i != iEnd; ++i) 
00128             {
00129                 int phwheel = i->whNum ();
00130                 int phsec   = i->scNum () + 1; // SM The track finder goes from 0 to 11. I need them from 1 to 12 !!!!!
00131                 int phst    = i->stNum ();
00132                 int phbx    = i->bxNum ();
00133                 int phcode  = i->code ();
00134                 int phi1st  = i->Ts2Tag ();
00135                 int phphi   = i->phi ();
00136                 int phphiB  = i->phiB ();
00137 
00138                 if (phcode > phcode_best [phwheel + 3][phst][phsec] && phcode < 7) 
00139                 {
00140                     phcode_best [phwheel + 3][phst][phsec] = phcode; 
00141                     ibest [phwheel + 3][phst][phsec] = i;
00142                     std::cout << "--> Best Phi: " << phphi << std::endl;
00143                 }
00144                 
00145                 DTChamberId dtChId (phwheel, phst, phsec);
00146                 uint32_t indexCh = dtChId.rawId ();
00147                 uint32_t indexScWh = 5 * (phsec - 1) + (phwheel + 3);    // wheel + sector identifier
00148                 std::cout << "Wheel " << phwheel << "; Station " << phst << "; Sector " << phsec << std::endl;
00149                 std::cout << "Phi: " << phphi << std::endl;
00150             }
00151         }
00152     }
00153     catch (cms::Exception& e)
00154     {
00155         if (this->m_onCmsException)
00156             this->m_onCmsException (&e);
00157     }
00158     catch (lat::Error &e) 
00159     {
00160         if (this->m_onError)
00161             this->m_onError (&e);
00162     }
00163     catch (std::exception &e) 
00164     {
00165         if (this->m_onException)
00166             this->m_onException (&e);
00167     }
00168     catch (...) 
00169     {
00170         if (this->m_onUnhandledException)
00171             this->m_onUnhandledException ();
00172     }
00173 
00174     VisQueuedTwig::onBaseInvalidate ();
00175 }

void VisL1MuDTChambPhContainerTwig::update ( IgTextRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 187 of file VisL1MuDTChambPhContainerTwig.cc.

References m_decision, m_text, IgTextRep::setText(), and VisQueuedTwig::update().

00188 {
00189     // Get debugging dump.
00190     VisQueuedTwig::update (rep);
00191 
00192     // Prepare the property description.
00193     std::ostringstream text;
00194 
00195     text << m_text;
00196   
00197     text << setiosflags (std::ios::showpoint | std::ios::fixed);
00198     text.setf (std::ios::right, std::ios::adjustfield);
00199     text << "<table width='100%' border=1>"
00200          << "<TR align = center>"
00201          << "<TH>DetId</TH>"
00202          << "<TH>Wheel</TH>"
00203          << "<TH>Station</TH>"
00204          << "<TH>Sector</TH>"
00205          << "</TR>";
00206 
00207     text << "<TR><TH>" << m_decision.latin1 () << "</TH></TR>";
00208     
00209     text << "</table>";  
00210 
00211     IgQtLock ();
00212     rep->setText (text.str ());
00213 }

void VisL1MuDTChambPhContainerTwig::update ( Ig3DRep rep  )  [virtual]

Reimplemented from VisQueuedTwig.

Definition at line 178 of file VisL1MuDTChambPhContainerTwig.cc.

References VisQueuedTwig::update().

00179 {
00180     // Get debugging dump.
00181     VisQueuedTwig::update (rep);
00182 
00183     IgQtLock ();
00184 }


Member Data Documentation

QString VisL1MuDTChambPhContainerTwig::m_decision [private]

Definition at line 49 of file VisL1MuDTChambPhContainerTwig.h.

Referenced by update().

std::string VisL1MuDTChambPhContainerTwig::m_friendlyName [private]

Definition at line 43 of file VisL1MuDTChambPhContainerTwig.h.

std::string VisL1MuDTChambPhContainerTwig::m_instanceName [private]

Definition at line 45 of file VisL1MuDTChambPhContainerTwig.h.

std::string VisL1MuDTChambPhContainerTwig::m_moduleLabel [private]

Definition at line 44 of file VisL1MuDTChambPhContainerTwig.h.

edm::ESHandle<DTGeometry> VisL1MuDTChambPhContainerTwig::m_muonGeom [private]

Definition at line 48 of file VisL1MuDTChambPhContainerTwig.h.

Referenced by onNewEvent().

std::vector<L1MuDTChambPhDigi>* VisL1MuDTChambPhContainerTwig::m_phiContainer [private]

Definition at line 47 of file VisL1MuDTChambPhContainerTwig.h.

Referenced by onNewEvent().

std::string VisL1MuDTChambPhContainerTwig::m_processName [private]

Definition at line 46 of file VisL1MuDTChambPhContainerTwig.h.

IgState* VisL1MuDTChambPhContainerTwig::m_state [private]

Reimplemented from VisQueuedTwig.

Definition at line 41 of file VisL1MuDTChambPhContainerTwig.h.

std::string VisL1MuDTChambPhContainerTwig::m_text [private]

Definition at line 42 of file VisL1MuDTChambPhContainerTwig.h.

Referenced by onNewEvent(), and update().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:31 2009 for CMSSW by  doxygen 1.5.4