CMS 3D CMS Logo

IgSoRectColHist.h

Go to the documentation of this file.
00001 #ifndef IG_OPEN_INVENTOR_IG_SO_RECT_COL_HIST_H
00002 # define IG_OPEN_INVENTOR_IG_SO_RECT_COL_HIST_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "Iguana/Inventor/interface/IgSoShapeKit.h"
00007 # include <Inventor/fields/SoSFFloat.h>
00008 # include <Inventor/fields/SoSFUInt32.h>
00009 # include <Inventor/fields/SoSFBool.h>
00010 # include <Inventor/fields/SoMFFloat.h>
00011 # include <Inventor/fields/SoSFVec3f.h>
00012 # include <Inventor/fields/SoMFColor.h>
00013 # include <Inventor/fields/SoSFColor.h>
00014 # include <Inventor/SbVec3f.h>
00015 
00016 // # include "Iguana/Utilities/classlib/utils/DebugAids.h"
00017 
00018 # include <vector>
00019 # ifdef WIN32
00020 #  include <SoWinLeaveScope.h>
00021 # endif
00022 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00023 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00024 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00025 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00026 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00027 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00028 
00029 class IG_OPEN_INVENTOR_API IgSoRectColHist: public IgSoShapeKit
00030 {
00031 
00032         SO_KIT_HEADER (IgSoRectColHist);
00033         SO_KIT_CATALOG_ENTRY_HEADER (shapeHints);
00034         SO_KIT_CATALOG_ENTRY_HEADER (faceSet);
00035 //      SO_KIT_CATALOG_ENTRY_HEADER (inPosFaceSet);
00036 //      SO_KIT_CATALOG_ENTRY_HEADER (outPosFaceSet);
00037 //      SO_KIT_CATALOG_ENTRY_HEADER (inNegFaceSet);
00038 //      SO_KIT_CATALOG_ENTRY_HEADER (outNegFaceSet);
00039         SO_KIT_CATALOG_ENTRY_HEADER (lineSet);
00040 
00041 //      SO_KIT_CATALOG_ENTRY_HEADER (soAnnotation);
00042 
00043 public:
00044         IgSoRectColHist ();
00045         static void initClass (void);
00046     
00047         SoSFFloat  radiusR;
00048         SoSFFloat  radiusZ;
00049         SoSFFloat  offsetR;
00050         SoSFFloat  offsetZ;
00051         SoSFUInt32 numR; //number of bins (r)
00052         SoSFUInt32 numZ; //number of bins (z)
00053         SoMFFloat  energies; // note that we need to pass the 2 * binNum = 2 * (2*numR + 2*numZ) elements, since we have EM and hadronic values
00054         SoSFFloat  layer;
00055         SoSFVec3f  center;
00056         SoMFColor  faceColors;
00057         SoSFColor  lineColor;
00058         
00059         //scaling data members
00060         SoSFBool  logScale;
00061         SoSFFloat scaleFactor;
00062         SoSFFloat maxDist;
00063         
00064         SoSFFloat barrelMaxEta;
00065         SoSFFloat beamPipeTheta;  // half of the opening
00066         SoSFFloat endcapMaxTheta; // doesnt necessarily have to be the same as barrelMaxEta 
00067         
00068         //annotations
00069 //      SoSFBool        showAnnotations;
00070 
00071         enum n_placement {TOP, RIGHT, BOTTOM, LEFT};
00072 
00073 protected:
00074         virtual void refresh (void);
00075     
00076 private:
00077         float m_maxEnergy;
00078         float m_barrelDeltaEta;
00079         float m_barrelMaxEta;
00080         float m_endcapDeltaTheta;
00081         float m_endcapMaxTheta;
00082         bool  m_deltasSet;
00083         
00084         const static unsigned IN;
00085         const static unsigned OUT;
00086         
00087         void             addOffset (SbVec3f& point, unsigned binNum);
00088         float            angleToLeftHanded (float rightHandedAngle);
00089         std::vector<int> assignIndices (std::vector<std::vector<float> >& localEnergies, std::vector<int>& colorIndices);
00090         SbVec3f          calcAnglePoint (float angle, float x, float y);
00091         void             calcBinCorner (unsigned i, SbVec3f& left, SbVec3f& right);
00092         float            calcLocalRadius (const SbVec3f& point, const SbVec3f& center) const;
00093         void             calcLogEnergies (std::vector<std::vector<float> >& logEnergies);
00094         float            convertAngle (float angle);
00095         SbVec3f          convertCoordinates (const float radius, const float phi, const SbVec3f& center);
00096         void             determineAngularDelta (void);
00097         n_placement      findBinPlacement (const unsigned binIndex);
00098         int              findMaxEnergyBin (std::vector<std::vector<float> >& energies);
00099         float            getBinAngle (unsigned binNum, bool isLeftPoint);
00100         SbVec3f          projectPoint (const float energy, const SbVec3f& point, const SbVec3f& center);
00101         void             scaleEnergies (std::vector<std::vector<float> >& energies);
00102         void             setLogEnergies (std::vector<std::vector<float> >& energies);
00103         
00104         float            etaToTheta (float eta);
00105         float            thetaToEta (float theta);
00106 };
00107 
00108 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00109 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00110 
00111 # ifdef WIN32
00112 #  include <SoWinEnterScope.h>
00113 # endif
00114 
00115 #endif // IG_OPEN_INVENTOR_IG_SO_RECT_HIST_H
00116 

Generated on Tue Jun 9 17:38:43 2009 for CMSSW by  doxygen 1.5.4