2 #include "boost/bind.hpp"
33 #include "TEveManager.h"
34 #include "TEveEventManager.h"
35 #include "TEveTrackPropagator.h"
36 #include "TGLWidget.h"
38 #include "TEveBrowser.h"
42 class CmsEveMagField :
public TEveMagField
50 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
51 virtual ~CmsEveMagField() {}
54 void SetFieldByCurrent(Float_t avg_current)
56 fField = -3.8 * avg_current / 18160.0;
61 virtual Float_t GetMaxFieldMag()
const override
66 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const override
68 static const Float_t barrelFac = 1.2 / 3.8;
69 static const Float_t endcapFac = 2.0 / 3.8;
71 const Float_t
R =
sqrt(x*x+y*y);
78 if (R < 300.0
f)
return TEveVector(0, 0, fField);
81 if ((R > 461.0
f && R < 490.5
f) ||
82 (R > 534.5
f && R < 597.5
f) ||
83 (R > 637.0
f && R < 700.0
f))
85 return TEveVector(0, 0, -fField*barrelFac);
88 if ((absZ > 724.0
f && absZ < 786.0
f) ||
89 (absZ > 850.0
f && absZ < 910.0
f) ||
90 (absZ > 975.0
f && absZ < 1003.0
f))
92 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
93 return TEveVector(x*fac, y*fac, 0);
96 return TEveVector(0, 0, 0);
117 m_context(new fireworks::
Context(changeManager(),
121 m_metadataManager.
get())),
123 m_Rint(m_appHelper.app()),
128 printf(
"FWFFService::FWFFService CTOR\n");
138 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
139 const char *workarea = getenv(
"CMSSW_BASE");
140 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
141 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
146 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
147 displayConfigFilename = releaseBase + displayConfigRelFilename;
148 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
149 displayConfigFilename = workarea + displayConfigRelFilename;
151 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
152 geometryFilename = releaseBase + geometryRelFilename;
153 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
154 geometryFilename = workarea + geometryRelFilename;
164 if (!geometryFilename.empty())
184 printf(
"FWFFService::~FWFFService DTOR\n");
197 printf(
"FWFFService::postBeginJob\n");
203 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
209 gSystem->ProcessEvents();
215 printf(
"FWFFService::postEndJob\n");
217 TEveManager::Terminate();
235 if (!
guiManager()->playEventsAction()->isEnabled())
273 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
276 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
277 current = runCond->BAvgCurrent;
281 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
286 current = sum->m_avg_current;
287 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
290 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
297 printf(
"FWFFService::postProcessEvent: Starting GUI loop.\n");
341 printf(
"FWFFService exiting on user request.\n");
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
bool getByLabel(std::string const &label, Handle< PROD > &result) const
T getUntrackedParameter(std::string const &, T const &) const
std::auto_ptr< FWFFNavigator > m_navigator
FWGUIManager * guiManager()
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void initMap(const FWRecoGeom::InfoMap &map)
FWFFService(const edm::ParameterSet &, edm::ActivityRegistry &)
void postProcessEvent(const edm::Event &, const edm::EventSetup &)
FWEventItemsManager * eiManager()
void postBeginRun(const edm::Run &, const edm::EventSetup &)
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
void updateStatus(const char *status)
void setContext(fireworks::Context *)
void enableNavigatorControls()
void setGeometryFilename(const std::string &filename)
void setupFieldForPropagator(TEveTrackPropagator *prop)
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
CmsShowTaskExecutor * startupTasks()
void setupConfiguration()
CmsShowMainFrame * getMainFrame() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
TEveMagField * getMagField()
TEveMagField * m_MagField
T const * product() const
CSGContinuousAction * playEventsAction()
std::auto_ptr< FWFFMetadataManager > m_metadataManager
void display(const std::string &info="")
boost::function0< void > TaskFunctor
void addTask(const TaskFunctor &iTask)
std::auto_ptr< fireworks::Context > m_context
const std::string & geometryFilename(void)
void setConfigFilename(const std::string &f)
virtual void checkPosition()
T get(const Candidate &c)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal