Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:28

0001 #include "Fireworks/Calo/plugins/FWCaloRecHitDigitSetProxyBuilder.h"
0002 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0003 
0004 class FWHORecHitProxyBuilder : public FWCaloRecHitDigitSetProxyBuilder {
0005 public:
0006   FWHORecHitProxyBuilder(void) { invertBox(true); }
0007   ~FWHORecHitProxyBuilder(void) override {}
0008 
0009   REGISTER_PROXYBUILDER_METHODS();
0010 
0011   FWHORecHitProxyBuilder(const FWHORecHitProxyBuilder&) = delete;
0012   const FWHORecHitProxyBuilder& operator=(const FWHORecHitProxyBuilder&) = delete;
0013 };
0014 
0015 REGISTER_FWPROXYBUILDER(FWHORecHitProxyBuilder, HORecHitCollection, "HO RecHit", FWViewType::kISpyBit);
0016 
0017 // AMT scale around center, box is inverted. Scaling and e/et mode added now. Previously used fireworks::energyScaledBox3DCorners().
0018 
0019 /*
0020 void
0021 FWHORecHitProxyBuilder::build( const FWEventItem* iItem, TEveElementList* product, const FWViewContext* )
0022 {
0023    const HORecHitCollection* collection = 0;
0024    iItem->get( collection );
0025 
0026    if( 0 == collection )
0027    {
0028       return;
0029    }
0030    std::vector<HORecHit>::const_iterator it = collection->begin();
0031    std::vector<HORecHit>::const_iterator itEnd = collection->end();
0032    for( ; it != itEnd; ++it )
0033    {
0034       if(( *it ).energy() > m_maxEnergy)
0035          m_maxEnergy = ( *it ).energy();
0036    }
0037 
0038    TEveBoxSet* boxSet = addBoxSetToProduct(product);
0039    int index = 0;
0040    for (std::vector<HORecHit>::const_iterator it = collection->begin() ; it != collection->end(); ++it)
0041    {  
0042       const float* corners = item()->getGeom()->getCorners((*it).detid());
0043       std::vector<float> scaledCorners(24);
0044       if (corners)
0045          fireworks::energyScaledBox3DCorners(corners, (*it).energy() / m_maxEnergy, scaledCorners, true);
0046 
0047       addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
0048    }
0049 }
0050 */